-
Notifications
You must be signed in to change notification settings - Fork 1
/
ecs_notebooks_vscode.tf
69 lines (55 loc) · 1.88 KB
/
ecs_notebooks_vscode.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
resource "aws_ecs_task_definition" "vscode" {
family = "${var.prefix}-vscode"
container_definitions = templatefile(
"${path.module}/ecs_notebooks_notebook_container_definitions.json", {
container_image = "${aws_ecr_repository.vscode.repository_url}:master"
container_name = "${local.notebook_container_name}"
log_group = "${aws_cloudwatch_log_group.notebook.name}"
log_region = "${data.aws_region.aws_region.name}"
sentry_dsn = "${var.sentry_notebooks_dsn}"
sentry_environment = "${var.sentry_environment}"
metrics_container_image = "${aws_ecr_repository.metrics.repository_url}:master"
s3sync_container_image = "${aws_ecr_repository.s3sync.repository_url}:master"
cloudwatch_namespace = "${var.cloudwatch_namespace}"
cloudwatch_region = "${var.cloudwatch_region}"
home_directory = "/home/coder"
}
)
execution_role_arn = aws_iam_role.notebook_task_execution.arn
network_mode = "awsvpc"
cpu = local.notebook_container_cpu
memory = local.notebook_container_memory
requires_compatibilities = ["FARGATE"]
ephemeral_storage {
size_in_gib = 50
}
volume {
name = "home_directory"
}
lifecycle {
ignore_changes = [
"revision",
]
}
}
data "external" "vscode_current_tag" {
program = ["${path.module}/task_definition_tag.sh"]
query = {
task_family = "${var.prefix}-vscode"
container_name = "${local.notebook_container_name}"
}
}
data "external" "vscode_metrics_current_tag" {
program = ["${path.module}/task_definition_tag.sh"]
query = {
task_family = "${var.prefix}-vscode"
container_name = "metrics"
}
}
data "external" "vscode_s3sync_current_tag" {
program = ["${path.module}/task_definition_tag.sh"]
query = {
task_family = "${var.prefix}-vscode"
container_name = "s3sync"
}
}