Skip to content

Commit 2aa9d32

Browse files
committed
NDR-213 mtls custom cert subdomain prefix
1 parent d4ac4f3 commit 2aa9d32

File tree

5 files changed

+12
-2
lines changed

5 files changed

+12
-2
lines changed

infrastructure/dev.tfvars

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ owner = "nhse/ndr-team"
33
domain = "access-request-fulfilment.patient-deductions.nhs.uk"
44
certificate_domain = "access-request-fulfilment.patient-deductions.nhs.uk"
55
certificate_subdomain_name_prefix = "api-"
6+
certificate_subdomain_name_prefix_mtls = "mtls-"
67

78
standalone_vpc_tag = "ndr-dev"
89
standalone_vpc_ig_tag = "ndr-dev"

infrastructure/preprod.tfvars

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ owner = "nhse/ndr-team"
33
domain = "national-document-repository.nhs.uk"
44
certificate_domain = "pre-prod.national-document-repository.nhs.uk"
55
certificate_subdomain_name_prefix = "api."
6+
certificate_subdomain_name_prefix_mtls = "mtls."
67

78
standalone_vpc_tag = "ndr-pre-prod"
89
standalone_vpc_ig_tag = "ndr-pre-prod"

infrastructure/prod.tfvars

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ owner = "nhse/ndr-team"
33
domain = "national-document-repository.nhs.uk"
44
certificate_domain = "national-document-repository.nhs.uk"
55
certificate_subdomain_name_prefix = "api."
6+
certificate_subdomain_name_prefix_mtls = "mtls."
67

78
standalone_vpc_tag = "ndr-prod"
89
standalone_vpc_ig_tag = "ndr-prod"

infrastructure/test.tfvars

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ owner = "nhse/ndr-team"
33
domain = "access-request-fulfilment.patient-deductions.nhs.uk"
44
certificate_domain = "ndr-test.access-request-fulfilment.patient-deductions.nhs.uk"
55
certificate_subdomain_name_prefix = "api."
6+
certificate_subdomain_name_prefix_mtls = "mtls."
67

78
standalone_vpc_tag = "ndr-test"
89
standalone_vpc_ig_tag = "ndr-test"

infrastructure/variable.tf

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ variable "certificate_subdomain_name_prefix" {
2020
default = "api-"
2121
}
2222

23+
variable "certificate_subdomain_name_prefix_mtls" {
24+
description = "Prefix to add to subdomains on certification configurations, dev envs use api-{env}, prod envs use api.{env}."
25+
type = string
26+
default = "mtls-"
27+
}
28+
2329
# Bucket Variables
2430
variable "docstore_bucket_name" {
2531
description = "The name of the S3 bucket to store ARF documents."
@@ -225,8 +231,8 @@ locals {
225231
api_gateway_subdomain_name = contains(["prod"], terraform.workspace) ? "${var.certificate_subdomain_name_prefix}" : "${var.certificate_subdomain_name_prefix}${terraform.workspace}"
226232
api_gateway_full_domain_name = contains(["prod"], terraform.workspace) ? "${var.certificate_subdomain_name_prefix}${var.domain}" : "${var.certificate_subdomain_name_prefix}${terraform.workspace}.${var.domain}"
227233

228-
mtls_api_gateway_subdomain_name = contains(["prod"], terraform.workspace) ? "mtls.${var.certificate_subdomain_name_prefix}" : "mtls.${var.certificate_subdomain_name_prefix}${terraform.workspace}"
229-
mtls_api_gateway_full_domain_name = contains(["prod"], terraform.workspace) ? "mtls.${var.domain}" : "mtls.${terraform.workspace}.${var.domain}"
234+
mtls_api_gateway_subdomain_name = contains(["prod"], terraform.workspace) ? "${var.certificate_subdomain_name_prefix_mtls}" : "${var.certificate_subdomain_name_prefix_mtls}${terraform.workspace}"
235+
mtls_api_gateway_full_domain_name = contains(["prod"], terraform.workspace) ? "${var.certificate_subdomain_name_prefix_mtls}${var.domain}" : "${var.certificate_subdomain_name_prefix_mtls}${terraform.workspace}.${var.domain}"
230236

231237
current_region = data.aws_region.current.name
232238
current_account_id = data.aws_caller_identity.current.account_id

0 commit comments

Comments
 (0)