-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathecs-task-def.tf
33 lines (33 loc) · 877 Bytes
/
ecs-task-def.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
resource "aws_ecs_task_definition" "this" {
family = "${var.service_name}"
execution_role_arn = "${aws_iam_role.execution_role.arn}"
task_role_arn = "${aws_iam_role.task_role.arn}"
network_mode = "bridge"
requires_compatibilities = ["EC2"]
container_definitions = <<DEFINITION
[
{
"portMappings": [
{
"hostPort": 0,
"protocol": "tcp",
"containerPort": ${var.container_port}
}
],
"environment": [
{
"name": "PORT",
"value": "${var.container_port}"
},
{
"name" : "APP_NAME",
"value": "${var.service_name}"
}
],
"memoryReservation" : ${var.memory_reserv},
"image": "gnokoheat/ecs-nodejs-initial:latest",
"name": "${var.service_name}"
}
]
DEFINITION
}