Skip to content

Commit

Permalink
flatten()
Browse files Browse the repository at this point in the history
  • Loading branch information
carlssonk committed Sep 26, 2024
1 parent 2eff5b1 commit cb247f2
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions common/security/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -127,21 +127,22 @@ module "security_group_nginx_rules" {
}]
])
egress_rules = flatten([
for port, _ in local.ecs_ports :
{
description = "Allow traffic to ECS tasks on port ${port}"
from_port = port
to_port = port
ip_protocol = "tcp"
referenced_security_group_id = module.security_group_ecs_tasks.id
}
[
for port, _ in local.ecs_ports :
{
description = "Allow traffic to ECS tasks on port ${port}"
from_port = port
to_port = port
ip_protocol = "tcp"
referenced_security_group_id = module.security_group_ecs_tasks.id
}
],
[
local.allow_dns_anywhere,
local.allow_http_anywhere_ipv4,
local.allow_https_anywhere_ipv4
]
)
])
}

module "security_group_ecs_tasks_rules" {
Expand Down

0 comments on commit cb247f2

Please sign in to comment.