File tree Expand file tree Collapse file tree
infrastructure/stacks/api-layer Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,11 +7,6 @@ module "s3_truststore_bucket" {
77 workspace = terraform. workspace
88}
99
10- resource "aws_s3_bucket_policy" "truststore" {
11- bucket = module. s3_truststore_bucket . storage_bucket_id
12- policy = data. aws_iam_policy_document . truststore_api_gateway . json
13- }
14-
1510data "aws_iam_policy_document" "truststore_api_gateway" {
1611 statement {
1712 sid = " Enable S3 access permissions for API Gateway"
@@ -31,9 +26,16 @@ data "aws_iam_policy_document" "truststore_api_gateway" {
3126}
3227
3328resource "aws_s3_object" "pem_file" {
34- bucket = module. s3_truststore_bucket . storage_bucket_name
29+ bucket = module. s3_truststore_bucket . storage_bucket_id
3530 key = " truststore.pem"
3631 content = local. pem_file_content
3732
3833 acl = " private"
3934}
35+
36+ resource "aws_s3_bucket_policy" "truststore" {
37+ bucket = module. s3_truststore_bucket . storage_bucket_id
38+ policy = data. aws_iam_policy_document . truststore_api_gateway . json
39+
40+ depends_on = [aws_s3_object . pem_file ]
41+ }
You can’t perform that action at this time.
0 commit comments