Skip to content

Commit

Permalink
Merge pull request #21 from companieshouse/feature/CC-1124
Browse files Browse the repository at this point in the history
CC-1124 Add private load balancer mapping
  • Loading branch information
NeilShadrach authored Jan 24, 2024
2 parents d8176df + 750f2c6 commit 7563b46
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
9 changes: 9 additions & 0 deletions terraform/groups/ecs-service/data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,15 @@ data "aws_lb_listener" "service_lb_listener" {
port = 443
}

data "aws_lb" "secondary_lb" {
name = "${var.environment}-chs-apichgovuk-private"
}

data "aws_lb_listener" "secondary_lb_listener" {
load_balancer_arn = data.aws_lb.secondary_lb.arn
port = 443
}

# retrieve all secrets for this stack using the stack path
data "aws_ssm_parameters_by_path" "secrets" {
path = "/${local.name_prefix}"
Expand Down
6 changes: 6 additions & 0 deletions terraform/groups/ecs-service/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ module "ecs-service" {
lb_listener_arn = data.aws_lb_listener.service_lb_listener.arn
lb_listener_rule_priority = local.lb_listener_rule_priority
lb_listener_paths = local.lb_listener_paths
multilb_listeners = {
"priv-api-lb": {
listener_arn = data.aws_lb_listener.secondary_lb_listener.arn,
load_balancer_arn = data.aws_lb.secondary_lb.arn
}
}

# ECS Task container health check
use_task_container_healthcheck = true
Expand Down

0 comments on commit 7563b46

Please sign in to comment.