-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlocals.tf
47 lines (43 loc) · 943 Bytes
/
locals.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
locals {
region = var.aws_region
ecr_defaults = {
repository_name = "app-registry"
}
ecr = merge(local.ecr_defaults, var.ecr_values)
ecs_defaults = {
cluster_name = "ecs-cluster"
service_name = "ecs-service"
ecs_task_arn = null
}
ecs = merge(local.ecs_defaults, var.ecs_values)
lb_defaults = {
internal = false
target_group = {
name = "tf-alb-tg"
port = 80
protocol = "HTTP"
}
}
lb = merge(local.lb_defaults, var.lb_values)
container_defaults = {
name = "application"
image = "particule/helloworld"
ports = [80]
}
container = merge(local.container_defaults, var.container)
addons_defaults = {
loadbalancer = {
enable = true
}
ecr = {
enable = true
}
iam = {
enable = true
}
}
addons = {
for key, defaults in local.addons_defaults :
key => merge(defaults, lookup(var.addons, key, {}))
}
}