Skip to content

Commit ab53f1d

Browse files
committed
re-adding in shared-services lockdown
1 parent 6e97df3 commit ab53f1d

File tree

1 file changed

+12
-26
lines changed

1 file changed

+12
-26
lines changed

terraform-unity/networking.tf

Lines changed: 12 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
# Create an Application Load Balancer (ALB)
22
resource "aws_lb" "httpd_alb" {
3-
name = "${var.project}-${var.venue}-httpd-alb"
4-
# temporary switch until SPS tests are fixed
5-
#internal = true
6-
internal = false
7-
load_balancer_type = "application"
8-
security_groups = [aws_security_group.ecs_alb_sg.id]
9-
# temporary switch until SPS tests are fixed
10-
#subnets = local.subnet_ids
11-
subnets = local.public_subnet_ids
3+
name = "${var.project}-${var.venue}-httpd-alb"
4+
internal = true
5+
load_balancer_type = "application"
6+
security_groups = [aws_security_group.ecs_alb_sg.id]
7+
subnets = local.subnet_ids
128
enable_deletion_protection = false
139
preserve_host_header = true
1410
tags = {
@@ -136,23 +132,13 @@ data "aws_ssm_parameter" "shared-services_security_group" {
136132
name = "arn:aws:ssm:${data.aws_ssm_parameter.shared_service_region.value}:${data.aws_ssm_parameter.shared_service_account_id.value}:parameter/unity/shared-services/network/httpd_security_group"
137133
}
138134

139-
## lock down ecs alb to just shared services
140-
#resource "aws_vpc_security_group_ingress_rule" "ecs_alb_sg_ingress_rule" {
141-
# security_group_id = aws_security_group.ecs_alb_sg.id
142-
# from_port = 8080
143-
# to_port = 8080
144-
# ip_protocol = "tcp"
145-
# referenced_security_group_id = data.aws_ssm_parameter.shared-services_security_group.value
146-
#}
147-
148-
# temporary open until SPS tests are fixed
149-
#tfsec:ignore:AVD-AWS-0107
150-
resource "aws_vpc_security_group_ingress_rule" "ecs_alb_sg_ingress_rule_external" {
151-
security_group_id = aws_security_group.ecs_alb_sg.id
152-
from_port = 8080
153-
to_port = 8080
154-
ip_protocol = "tcp"
155-
cidr_ipv4 = "0.0.0.0/0"
135+
# lock down ecs alb to just shared services
136+
resource "aws_vpc_security_group_ingress_rule" "ecs_alb_sg_ingress_rule" {
137+
security_group_id = aws_security_group.ecs_alb_sg.id
138+
from_port = 8080
139+
to_port = 8080
140+
ip_protocol = "tcp"
141+
referenced_security_group_id = data.aws_ssm_parameter.shared-services_security_group.value
156142
}
157143

158144
resource "aws_vpc_security_group_egress_rule" "ecs_sg_egress_rule" {

0 commit comments

Comments
 (0)