Skip to content

Commit 00faa97

Browse files
committed
CCM-11586: consolidation does make sonar happy
1 parent 8d30c4b commit 00faa97

File tree

2 files changed

+32
-28
lines changed

2 files changed

+32
-28
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# In manually configured (e.g. dev main, nonprod main, prod main) add lifecycle policy to permit manual management of cert
2+
resource "aws_s3_object" "placeholder_truststore" {
3+
count = var.manually_configure_mtls_truststore ? 1 : 0
4+
bucket = aws_s3_bucket.truststore.bucket
5+
key = "truststore.pem"
6+
content = module.supplier_ssl[0].cacert_pem
7+
8+
depends_on = [
9+
aws_s3_bucket_versioning.truststore,
10+
module.supplier_ssl
11+
]
12+
13+
lifecycle {
14+
ignore_changes = [
15+
content
16+
]
17+
}
18+
}
19+
20+
# In non-manually configured env (e.g. PR) exclude lifecycle policy so resources are managed
21+
# Requires duplicate block as lifecycle policies cannot be dynamic
22+
resource "aws_s3_object" "placeholder_truststore_nonprod" {
23+
count = !var.manually_configure_mtls_truststore ? 1 : 0
24+
bucket = aws_s3_bucket.truststore.bucket
25+
key = "truststore.pem"
26+
content = module.supplier_ssl[0].cacert_pem
27+
28+
depends_on = [
29+
aws_s3_bucket_versioning.truststore,
30+
module.supplier_ssl
31+
]
32+
}

infrastructure/terraform/components/api/s3_bucket_policy_truststore.tf

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)