Skip to content

Commit

Permalink
Merge pull request #8844 from ministryofjustice/feature/add-private-d…
Browse files Browse the repository at this point in the history
…ns-zone-development.yjaf

Add private DNS zone `development.yjaf` for internal use
  • Loading branch information
sukeshreddyg authored Jan 3, 2025
2 parents 0a29a7e + db0b321 commit c77b872
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
9 changes: 1 addition & 8 deletions terraform/environments/core-network-services/iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,6 @@ resource "aws_iam_role_policy_attachment" "vpc_flow_log_publish_policy" {
policy_arn = aws_iam_policy.vpc_flow_log_publish_policy.arn
}


data "aws_route53_zone" "private-zones" {
for_each = local.private-application-zones
name = each.value
private_zone = true
}

# Role to allow ci/cd to update DNS records for ACM certificate validation
resource "aws_iam_role" "dns" {
#checkov:skip=CKV_AWS_60:Wildcard constrained by condition checks
Expand Down Expand Up @@ -130,7 +123,7 @@ resource "aws_iam_role_policy" "dns" {
Action = ["route53:ChangeResourceRecordSets"],
Resource = concat(
[for zone in aws_route53_zone.application_zones : format("arn:aws:route53:::hostedzone/%s", zone.id)],
[for zone in data.aws_route53_zone.private-zones : format("arn:aws:route53:::hostedzone/%s", zone.id)],
[for zone in aws_route53_zone.private_application_zones : format("arn:aws:route53:::hostedzone/%s", zone.id)],
[
"arn:aws:route53:::hostedzone/${aws_route53_zone.modernisation-platform.id}",
"arn:aws:route53:::hostedzone/${aws_route53_zone.modernisation-platform-internal.id}"
Expand Down
1 change: 1 addition & 0 deletions terraform/environments/core-network-services/route53.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ locals {
}

private-application-zones = {
yjaf-development = "development.yjaf"
}
}

Expand Down

0 comments on commit c77b872

Please sign in to comment.