-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
52 lines (46 loc) · 1.1 KB
/
main.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
module "first_container" {
source = "../../"
container_name = "name"
container_image = "cloudposse/geodesic"
port_mappings = [
{
containerPort = 8080
hostPort = 80
protocol = "tcp"
},
{
containerPort = 8081
hostPort = 443
protocol = "udp"
}
]
}
module "second_container" {
source = "../../"
container_name = "name2"
container_image = "cloudposse/geodesic"
port_mappings = [
{
containerPort = 8080
hostPort = 8080
protocol = "tcp"
},
{
containerPort = 8081
hostPort = 444
protocol = "udp"
}
]
}
output "first_container_json" {
description = "Container definition in JSON format"
value = module.first_container.json
}
output "second_container_json" {
description = "Container definition in JSON format"
value = module.second_container.json
}
resource "aws_ecs_task_definition" "task" {
family = "foo"
container_definitions = "[${module.first_container.json_map},${module.second_container.json_map}]"
}