File tree Expand file tree Collapse file tree 4 files changed +4
-3
lines changed Expand file tree Collapse file tree 4 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -146,7 +146,7 @@ module "web_service" {
146
146
vpc_id = aws_vpc.application_vpc.id
147
147
}
148
148
loadbalancer = {
149
- target_group_arn = aws_lb_target_group.green.arn
149
+ target_group_arn = local.ecs_initial_lb_target_group
150
150
container_port = 4000
151
151
}
152
152
cluster_id = aws_ecs_cluster. cluster . id
Original file line number Diff line number Diff line change @@ -26,3 +26,4 @@ http_hosts = {
26
26
27
27
minimum_replicas = 3
28
28
appspec_bucket = " nhse-mavis-appspec-bucket-preview"
29
+ ecs_initial_lb_target_group = " green"
Original file line number Diff line number Diff line change @@ -150,7 +150,7 @@ resource "aws_lb_listener_rule" "forward_to_app" {
150
150
priority = 50000
151
151
action {
152
152
type = " forward"
153
- target_group_arn = local. default_lb_target_group_arn
153
+ target_group_arn = local. ecs_initial_lb_target_group
154
154
}
155
155
condition {
156
156
path_pattern {
Original file line number Diff line number Diff line change @@ -257,6 +257,6 @@ variable "active_lb_target_group" {
257
257
}
258
258
259
259
locals {
260
- default_lb_target_group_arn = var. active_lb_target_group == " green" ? aws_lb_target_group. green . arn : aws_lb_target_group. blue . arn
260
+ ecs_initial_lb_target_group = var. active_lb_target_group == " green" ? aws_lb_target_group. green . arn : aws_lb_target_group. blue . arn
261
261
ecs_sg_ids = [module . web_service . security_group_id , module . good_job_service . security_group_id ]
262
262
}
You can’t perform that action at this time.
0 commit comments