Skip to content

Commit

Permalink
Do correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
vertism committed Jan 29, 2024
1 parent b134766 commit 12e154e
Showing 1 changed file with 8 additions and 21 deletions.
29 changes: 8 additions & 21 deletions terraform/environments/cdpt-chaps/route53.tf
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// DEV + PRE-PRODUCTION DNS CONFIGURATION
// OLD to be deleted

// ACM Public Certificate
resource "aws_acm_certificate" "external" {
domain_name = "modernisation-platform.service.justice.gov.uk"
validation_method = "DNS"

subject_alternative_names = ["${var.networking[0].application}.${local.environment}.modernisation-platform.service.justice.gov.uk"]
subject_alternative_names = ["${var.networking[0].application}.${var.networking[0].business-unit}-${local.environment}.modernisation-platform.service.justice.gov.uk"]
tags = {
Environment = local.environment
}
Expand Down Expand Up @@ -43,26 +43,13 @@ resource "aws_route53_record" "external_validation_subdomain" {
zone_id = data.aws_route53_zone.external.zone_id
}

// Route53 DNS record for directing traffic to the service
resource "aws_route53_record" "external" {
provider = aws.core-vpc

zone_id = data.aws_route53_zone.external.zone_id
name = "${var.networking[0].application}.${var.networking[0].business-unit}-${local.environment}.modernisation-platform.service.justice.gov.uk"
type = "A"

alias {
name = aws_lb.chaps_lb.dns_name
zone_id = aws_lb.chaps_lb.zone_id
evaluate_target_health = true
}
}



// NEW - to be kept


// DEV + PRE-PRODUCTION DNS CONFIGURATION

// ACM Public Certificate
resource "aws_acm_certificate" "external_cert" {
domain_name = "modernisation-platform.service.justice.gov.uk"
validation_method = "DNS"
Expand Down Expand Up @@ -102,15 +89,15 @@ resource "aws_route53_record" "external_cert_validation_subdomain" {
records = local.domain_record_sub
ttl = 60
type = local.domain_type_sub[0]
zone_id = data.aws_route53_zone.external.zone_id
zone_id = data.aws_route53_zone.external_cert.zone_id
}

// Route53 DNS record for directing traffic to the service
resource "aws_route53_record" "external_cert" {
provider = aws.core-vpc

zone_id = data.aws_route53_zone.external.zone_id
name = "${var.networking[0].application}.${var.networking[0].business-unit}-${local.application_data.accounts[local.environment].environment_name}.modernisation-platform.service.justice.gov.uk"
zone_id = data.aws_route53_zone.external_cert.zone_id
name = "${var.networking[0].application}.${var.networking[0].business-unit}-${local.environment}.modernisation-platform.service.justice.gov.uk"
type = "A"

alias {
Expand Down

0 comments on commit 12e154e

Please sign in to comment.