diff --git a/terraform/environments/cdpt-chaps/application_variables.json b/terraform/environments/cdpt-chaps/application_variables.json index 50c5dfbb969..c298975c4fb 100644 --- a/terraform/environments/cdpt-chaps/application_variables.json +++ b/terraform/environments/cdpt-chaps/application_variables.json @@ -8,7 +8,7 @@ "env_name": "DEVELOPMENT", "db_instance_identifier": "db-chaps-dev", "db_snapshot_identifier": "arn:aws:rds:eu-west-2:613903586696:snapshot:cdpt-dev-staging-2024-jan-24", - "docker_image_tag": "development", + "environment_name": "development", "app_count": 1, "ec2_desired_capacity": 1, "ec2_max_size": 2, @@ -27,7 +27,7 @@ "env_name": "STAGING", "db_instance_identifier": "chaps-preprod-instance", "db_snapshot_identifier": "arn:aws:rds:eu-west-2:613903586696:snapshot:cdpt-dev-staging-2024-jan-24", - "docker_image_tag": "preproduction", + "environment_name": "staging", "app_count": 2, "ec2_desired_capacity": 2, "ec2_max_size": 3, @@ -46,7 +46,7 @@ "env_name": "PRODUCTION", "db_instance_identifier": "chaps-prod-instance", "db_snapshot_identifier": "arn:aws:rds:eu-west-2:613903586696:snapshot:chaps-prod-snapshot-2024-01-22", - "docker_image_tag": "production", + "environment_name": "production", "app_count": 2, "ec2_desired_capacity": 2, "ec2_max_size": 3, diff --git a/terraform/environments/cdpt-chaps/ecs.tf b/terraform/environments/cdpt-chaps/ecs.tf index f9f3e3048d3..59fec743346 100644 --- a/terraform/environments/cdpt-chaps/ecs.tf +++ b/terraform/environments/cdpt-chaps/ecs.tf @@ -74,7 +74,7 @@ resource "aws_ecs_task_definition" "chaps_task_definition" { container_definitions = jsonencode([ { name = "${local.application_name}-container" - image = "${local.ecr_url}:${local.application_data.accounts[local.environment].docker_image_tag}" + image = "${local.ecr_url}:${local.application_data.accounts[local.environment].environment_name}" cpu = 1024 memory = 1024 essential = true diff --git a/terraform/environments/cdpt-chaps/route53.tf b/terraform/environments/cdpt-chaps/route53.tf index d34737a0f59..1419fbea170 100644 --- a/terraform/environments/cdpt-chaps/route53.tf +++ b/terraform/environments/cdpt-chaps/route53.tf @@ -5,7 +5,7 @@ resource "aws_acm_certificate" "external" { domain_name = "modernisation-platform.service.justice.gov.uk" validation_method = "DNS" - subject_alternative_names = ["${var.networking[0].application}.${var.networking[0].business-unit}-${local.environment}.modernisation-platform.service.justice.gov.uk"] + subject_alternative_names = ["${var.networking[0].application}.${var.networking[0].business-unit}-${local.application_data.accounts[local.environment].environment_name}.modernisation-platform.service.justice.gov.uk"] tags = { Environment = local.environment } @@ -48,7 +48,7 @@ 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" + name = "${var.networking[0].application}.${var.networking[0].business-unit}-${local.application_data.accounts[local.environment].environment_name}.modernisation-platform.service.justice.gov.uk" type = "A" alias {