|
1 | 1 | # Create an Application Load Balancer (ALB) |
2 | 2 | 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 |
12 | 8 | enable_deletion_protection = false |
13 | 9 | preserve_host_header = true |
14 | 10 | tags = { |
@@ -136,23 +132,13 @@ data "aws_ssm_parameter" "shared-services_security_group" { |
136 | 132 | 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" |
137 | 133 | } |
138 | 134 |
|
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 |
156 | 142 | } |
157 | 143 |
|
158 | 144 | resource "aws_vpc_security_group_egress_rule" "ecs_sg_egress_rule" { |
|
0 commit comments