-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtask_definitions.tf
More file actions
78 lines (77 loc) · 2.17 KB
/
Copy pathtask_definitions.tf
File metadata and controls
78 lines (77 loc) · 2.17 KB
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
70
71
72
73
74
75
76
77
78
resource "aws_ecs_task_definition" "app_task" {
count = var.enable_ecs ? 1 : 0
family = "${var.project_name}-task"
requires_compatibilities = ["FARGATE"]
network_mode = "awsvpc"
cpu = "512"
memory = "1024"
execution_role_arn = aws_iam_role.ecs_task_execution_role.arn
container_definitions = jsonencode([
{
name = "ecs-java-crud"
image = "${var.account_id}.dkr.ecr.${var.region}.amazonaws.com/ecs-java-crud:latest"
cpu = 128
memory = 256
essential = true
portMappings = [
{
containerPort = 8080
hostPort = 8080
protocol = "tcp"
}
]
logConfiguration = {
logDriver = "awslogs"
options = {
awslogs-group = "/ecs/trigger-redeploy"
awslogs-region = "${var.region}"
awslogs-stream-prefix = "java"
}
}
},
{
name = "titanic-fastapi-ecs"
image = "${var.account_id}.dkr.ecr.${var.region}.amazonaws.com/titanic-fastapi-ecs:latest"
cpu = 64
memory = 128
essential = false
portMappings = [
{
containerPort = 8001
hostPort = 8001
protocol = "tcp"
}
]
logConfiguration = {
logDriver = "awslogs"
options = {
awslogs-group = "/ecs/trigger-redeploy"
awslogs-region = "${var.region}"
awslogs-stream-prefix = "titanic"
}
}
},
{
name = "crud-ecs-python"
image = "${var.account_id}.dkr.ecr.${var.region}.amazonaws.com/crud-ecs-python:latest"
cpu = 128
memory = 256
essential = false
portMappings = [
{
containerPort = 8002
hostPort = 8002
protocol = "tcp"
}
]
logConfiguration = {
logDriver = "awslogs"
options = {
awslogs-group = "/ecs/trigger-redeploy"
awslogs-region = "${var.region}"
awslogs-stream-prefix = "python"
}
}
}
])
}