Skip to content

Commit

Permalink
MLPAB-1733 - Make the public access toggle include redirects and mock…
Browse files Browse the repository at this point in the history
… onelogin (#969)

* update targets for ur job

* remove private ingress when public ingress is added

* update lock
  • Loading branch information
andrewpearce-digital authored Jan 18, 2024
1 parent 8ba3074 commit 2e482bb
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,8 @@ jobs:
TF_WORKSPACE: ur
TF_VAR_pagerduty_api_key: ${{ secrets.pagerduty_api_key }}
run: |
terraform apply -lock-timeout=300s -input=false -auto-approve -var public_access_enabled=${{ inputs.public_access_enabled }} -target 'module.eu_west_1[0].module.app.aws_security_group_rule.app_loadbalancer_public_access_ingress[0]'
terraform apply -lock-timeout=300s -input=false -auto-approve -var public_access_enabled=${{ inputs.public_access_enabled }} \
-target 'module.eu_west_1[0].module.app.aws_security_group_rule.app_loadbalancer_public_access_ingress[0]' \
-target 'module.eu_west_1[0].module.app.aws_security_group_rule.app_loadbalancer_public_access_ingress_port_80[0]' \
-target 'module.eu_west_1[0].module.mock_onelogin[0].aws_security_group_rule.mock_onelogin_loadbalancer_public_access_ingress[0]' \
working-directory: ./terraform/environment
47 changes: 17 additions & 30 deletions terraform/environment/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions terraform/environment/region/modules/app/alb.tf
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ data "aws_ip_ranges" "route53_healthchecks" {
}

resource "aws_security_group_rule" "app_loadbalancer_port_80_redirect_ingress" {
count = var.public_access_enabled ? 0 : 1
description = "Port 80 ingress for redirection to port 443"
type = "ingress"
from_port = 80
Expand All @@ -166,6 +167,7 @@ resource "aws_security_group_rule" "app_loadbalancer_port_80_redirect_ingress" {
}

resource "aws_security_group_rule" "app_loadbalancer_ingress" {
count = var.public_access_enabled ? 0 : 1
description = "Port 443 ingress from the allow list to the application load balancer"
type = "ingress"
from_port = 443
Expand Down

0 comments on commit 2e482bb

Please sign in to comment.