Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions terraform/account-wide-infrastructure/dev/domain.tf
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@

module "dev-custom-domain-name" {
source = "../modules/env-custom-domain-name"
domain_name = var.dev_api_domain_name
domain_zone = aws_route53_zone.dev-ns.name
mtls_certificate_file = "s3://${module.dev-truststore-bucket.bucket_name}/${module.dev-truststore-bucket.certificates_object_key}"
source = "../modules/env-custom-domain-name"
domain_name = var.dev_api_domain_name
domain_zone = aws_route53_zone.dev-ns.name
mtls_certificate_file = "s3://${module.dev-truststore-bucket.bucket_name}/${module.dev-truststore-bucket.certificates_object_key}"
mtls_certificate_file_version = module.dev-truststore-bucket.certificates_object_version
}

module "devsandbox-custom-domain-name" {
source = "../modules/env-custom-domain-name"
domain_name = var.devsandbox_api_domain_name
domain_zone = aws_route53_zone.dev-ns.name
mtls_certificate_file = "s3://${module.dev-truststore-bucket.bucket_name}/${module.dev-truststore-bucket.certificates_object_key}"
source = "../modules/env-custom-domain-name"
domain_name = var.devsandbox_api_domain_name
domain_zone = aws_route53_zone.dev-ns.name
mtls_certificate_file = "s3://${module.dev-truststore-bucket.bucket_name}/${module.dev-truststore-bucket.certificates_object_key}"
mtls_certificate_file_version = module.dev-truststore-bucket.certificates_object_version
}
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,19 @@ module "developer_policy" {
"${data.aws_s3_bucket.ci_logging.arn}/*"
]
},
{
Action = [
"s3:PutObject",
"s3:GetObject",
"s3:DeleteObject"
]
Effect = "Deny"
Resource = [
"${data.aws_s3_bucket.truststore.arn}/ca/prod*",
"${data.aws_s3_bucket.truststore.arn}/client/prod*",
"${data.aws_s3_bucket.truststore.arn}/server/prod*"
]
},
{
Action = [
"s3:GetObject"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ resource "aws_api_gateway_domain_name" "domain" {
}

mutual_tls_authentication {
truststore_uri = var.mtls_certificate_file
truststore_uri = var.mtls_certificate_file
truststore_version = var.mtls_certificate_file_version
}

depends_on = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,8 @@ variable "mtls_certificate_file" {
description = "The path to the mtls certificate file"
type = string
}

variable "mtls_certificate_file_version" {
description = "The S3 version of the mtls certificate file"
type = string
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,8 @@ output "certificates_object_key" {
description = "Key of the truststore certificates object"
value = aws_s3_object.api_truststore_certificate.key
}

output "certificates_object_version" {
description = "Version of the truststore certificates object"
value = aws_s3_object.api_truststore_certificate.version_id
}
9 changes: 5 additions & 4 deletions terraform/account-wide-infrastructure/prod/domain.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@


module "dev-custom-domain-name" {
source = "../modules/env-custom-domain-name"
domain_name = var.prod_api_domain_name
domain_zone = aws_route53_zone.prod-ns.name
mtls_certificate_file = "s3://${module.prod-truststore-bucket.bucket_name}/${module.prod-truststore-bucket.certificates_object_key}"
source = "../modules/env-custom-domain-name"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not one for this PR, but the name of this module is confusing me 🤔

domain_name = var.prod_api_domain_name
domain_zone = aws_route53_zone.prod-ns.name
mtls_certificate_file = "s3://${module.prod-truststore-bucket.bucket_name}/${module.prod-truststore-bucket.certificates_object_key}"
mtls_certificate_file_version = module.prod-truststore-bucket.certificates_object_version
}
45 changes: 25 additions & 20 deletions terraform/account-wide-infrastructure/test/domain.tf
Original file line number Diff line number Diff line change
@@ -1,35 +1,40 @@

module "qa-custom-domain-name" {
source = "../modules/env-custom-domain-name"
domain_name = var.qa_api_domain_name
domain_zone = aws_route53_zone.test-qa-ns.name
mtls_certificate_file = "s3://${module.qa-truststore-bucket.bucket_name}/${module.qa-truststore-bucket.certificates_object_key}"
source = "../modules/env-custom-domain-name"
domain_name = var.qa_api_domain_name
domain_zone = aws_route53_zone.test-qa-ns.name
mtls_certificate_file = "s3://${module.qa-truststore-bucket.bucket_name}/${module.qa-truststore-bucket.certificates_object_key}"
mtls_certificate_file_version = module.qa-truststore-bucket.certificates_object_version
}

module "qasandbox-custom-domain-name" {
source = "../modules/env-custom-domain-name"
domain_name = var.qasandbox_api_domain_name
domain_zone = aws_route53_zone.test-qa-ns.name
mtls_certificate_file = "s3://${module.qa-truststore-bucket.bucket_name}/${module.qa-truststore-bucket.certificates_object_key}"
source = "../modules/env-custom-domain-name"
domain_name = var.qasandbox_api_domain_name
domain_zone = aws_route53_zone.test-qa-ns.name
mtls_certificate_file = "s3://${module.qa-truststore-bucket.bucket_name}/${module.qa-truststore-bucket.certificates_object_key}"
mtls_certificate_file_version = module.qa-truststore-bucket.certificates_object_version
}

module "int-custom-domain-name" {
source = "../modules/env-custom-domain-name"
domain_name = var.int_api_domain_name
domain_zone = aws_route53_zone.test-int-ns.name
mtls_certificate_file = "s3://${module.int-truststore-bucket.bucket_name}/${module.int-truststore-bucket.certificates_object_key}"
source = "../modules/env-custom-domain-name"
domain_name = var.int_api_domain_name
domain_zone = aws_route53_zone.test-int-ns.name
mtls_certificate_file = "s3://${module.int-truststore-bucket.bucket_name}/${module.int-truststore-bucket.certificates_object_key}"
mtls_certificate_file_version = module.int-truststore-bucket.certificates_object_version
}

module "intsandbox-custom-domain-name" {
source = "../modules/env-custom-domain-name"
domain_name = var.intsandbox_api_domain_name
domain_zone = aws_route53_zone.test-int-ns.name
mtls_certificate_file = "s3://${module.int-truststore-bucket.bucket_name}/${module.int-truststore-bucket.certificates_object_key}"
source = "../modules/env-custom-domain-name"
domain_name = var.intsandbox_api_domain_name
domain_zone = aws_route53_zone.test-int-ns.name
mtls_certificate_file = "s3://${module.int-truststore-bucket.bucket_name}/${module.int-truststore-bucket.certificates_object_key}"
mtls_certificate_file_version = module.int-truststore-bucket.certificates_object_version
}

module "ref-custom-domain-name" {
source = "../modules/env-custom-domain-name"
domain_name = var.ref_api_domain_name
domain_zone = aws_route53_zone.test-ref-ns.name
mtls_certificate_file = "s3://${module.ref-truststore-bucket.bucket_name}/${module.ref-truststore-bucket.certificates_object_key}"
source = "../modules/env-custom-domain-name"
domain_name = var.ref_api_domain_name
domain_zone = aws_route53_zone.test-ref-ns.name
mtls_certificate_file = "s3://${module.ref-truststore-bucket.bucket_name}/${module.ref-truststore-bucket.certificates_object_key}"
mtls_certificate_file_version = module.ref-truststore-bucket.certificates_object_version
}
3 changes: 2 additions & 1 deletion terraform/infrastructure/domain.tf
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ resource "aws_api_gateway_domain_name" "domain" {
}

mutual_tls_authentication {
truststore_uri = "s3://${data.aws_s3_object.api-truststore-certificate.bucket}/${data.aws_s3_object.api-truststore-certificate.key}"
truststore_uri = "s3://${data.aws_s3_object.api-truststore-certificate.bucket}/${data.aws_s3_object.api-truststore-certificate.key}"
truststore_version = data.aws_s3_object.api-truststore-certificate.version_id
}

depends_on = [
Expand Down