generated from rhythmictech/terraform-terraform-template
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathlocals.tf
32 lines (29 loc) · 938 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
########################################
# Locals
########################################
locals {
container_name = coalesce(var.container_name, "api-${var.name}")
# cannot be longer than 32 chars
ecs_exec_iam_role_name_prefix = "${substr(var.name, 0, 22)}-"
ecs_task_iam_role_name_prefix = "${substr(var.name, 0, 22)}-"
# cannot be longer than 6 chars
lb_target_group_name_prefix = "${substr(var.name, 0, 5)}-"
region = data.aws_region.current.name
create_task_def = var.task_def_arn == "" ? true : false
log_configuration = {
logDriver : "awslogs",
options = {
"awslogs-group" : aws_cloudwatch_log_group.this.name,
"awslogs-region" : "${local.region}",
"awslogs-stream-prefix" : "ecs"
}
secretOptions = []
}
port_mappings = [
{
containerPort = var.container_port
hostPort = var.container_port
protocol = "tcp"
},
]
}