File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
infrastructure/instance/modules/api_gateway Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,8 @@ resource "aws_apigatewayv2_domain_name" "service_api_domain_name" {
3838 security_policy = " TLS_1_2"
3939 }
4040 mutual_tls_authentication {
41- truststore_uri = " s3://${ aws_s3_bucket . truststore_bucket . bucket } /${ local . truststore_file_name } "
41+ truststore_uri = " s3://${ aws_s3_bucket . truststore_bucket . bucket } /${ local . truststore_file_name } "
42+ truststore_version = aws_s3_object_copy. copy_cert_from_storage . version_id
4243 }
4344 tags = {
4445 Name = " ${ var . prefix } -api-domain-name"
Original file line number Diff line number Diff line change @@ -12,13 +12,27 @@ data "aws_s3_object" "cert" {
1212 key = local. truststore_file_name
1313}
1414
15+ resource "terraform_data" "cert_etag" {
16+ input = data. aws_s3_object . cert . etag
17+ }
18+
1519resource "aws_s3_bucket" "truststore_bucket" {
1620 bucket = " ${ var . prefix } -truststores"
1721 force_destroy = true
1822}
1923
24+ resource "aws_s3_bucket_versioning" "truststore_bucket" {
25+ bucket = aws_s3_bucket. truststore_bucket . bucket
26+ versioning_configuration {
27+ status = " Enabled"
28+ }
29+ }
30+
2031resource "aws_s3_object_copy" "copy_cert_from_storage" {
2132 bucket = aws_s3_bucket. truststore_bucket . bucket
2233 key = local. truststore_file_name
2334 source = " ${ data . aws_s3_object . cert . bucket } /${ local . truststore_file_name } "
35+ lifecycle {
36+ replace_triggered_by = [terraform_data . cert_etag ]
37+ }
2438}
You can’t perform that action at this time.
0 commit comments