Skip to content

Commit 27b2671

Browse files
committed
CCM-11586: try fix truststore uri
1 parent 6dbea64 commit 27b2671

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

infrastructure/terraform/components/api/api_gateway_domain.tf

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@ resource "aws_api_gateway_domain_name" "main" {
99
}
1010

1111
depends_on = [
12-
aws_s3_bucket.truststore
12+
aws_s3_bucket.truststore,
13+
aws_s3_object.placeholder_truststore
1314
]
1415

1516
mutual_tls_authentication {
16-
truststore_uri = "s3://${aws_s3_bucket.truststore.id}/${aws_s3_object.placeholder_truststore[0].id}"
17+
truststore_uri = "s3://${aws_s3_bucket.truststore.id}/${aws_s3_object.placeholder_truststore[0].key}"
1718
truststore_version = aws_s3_object.placeholder_truststore[0].version_id
1819
}
1920

@@ -35,11 +36,12 @@ resource "aws_api_gateway_domain_name" "main_nonprod" {
3536
}
3637

3738
depends_on = [
38-
aws_s3_bucket.truststore
39+
aws_s3_bucket.truststore,
40+
aws_s3_object.placeholder_truststore_nonprod
3941
]
4042

4143
mutual_tls_authentication {
42-
truststore_uri = "s3://${aws_s3_bucket.truststore.id}/${aws_s3_object.placeholder_truststore_nonprod[0].id}"
44+
truststore_uri = "s3://${aws_s3_bucket.truststore.id}/${aws_s3_object.placeholder_truststore_nonprod[0].key}"
4345
truststore_version = aws_s3_object.placeholder_truststore_nonprod[0].version_id
4446
}
4547
}

infrastructure/terraform/components/api/s3_bucket_truststore.tf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ resource "aws_s3_object" "placeholder_truststore" {
5252
content = module.supplier_ssl[0].cacert_pem
5353

5454
depends_on = [
55-
aws_s3_bucket_versioning.truststore
55+
aws_s3_bucket_versioning.truststore,
56+
module.supplier_ssl
5657
]
5758

5859
lifecycle {
@@ -65,7 +66,7 @@ resource "aws_s3_object" "placeholder_truststore" {
6566
# In non-manually configured env (e.g. PR) exclude lifecycle policy so resources are managed
6667
# Requires duplicate block as lifecycle policies cannot be dynamic
6768
resource "aws_s3_object" "placeholder_truststore_nonprod" {
68-
count = var.manually_configure_mtls_truststore ? 0 : 1
69+
count = !var.manually_configure_mtls_truststore ? 1 : 0
6970
bucket = aws_s3_bucket.truststore.bucket
7071
key = "truststore.pem"
7172
content = module.supplier_ssl[0].cacert_pem

0 commit comments

Comments
 (0)