Skip to content

Commit 633effb

Browse files
committed
Fix SG self-reference: allow safe egress from ecs_tasks
1 parent 98eff00 commit 633effb

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

network.tf

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,13 @@ resource "aws_security_group" "ecs_tasks" {
9393
protocol = "tcp"
9494
from_port = 3000
9595
to_port = 3000
96-
security_groups = [aws_security_group.ecs_tasks.id]
96+
# Removed self-reference. Allow all outbound traffic from tasks so they can
97+
# reach other services (DNS, ECR, etc.). If you want tighter egress rules,
98+
# replace with specific cidr_blocks or security_groups pointing to other SGs.
99+
protocol = "-1"
100+
from_port = 0
101+
to_port = 0
102+
cidr_blocks = ["0.0.0.0/0"]
97103
}
98104
depends_on = [aws_security_group.alb]
99105
}

0 commit comments

Comments
 (0)