Skip to content

Commit ea5c188

Browse files
committed
fix: Resolve the problem of bucket exception resolution
1 parent 7e97b1e commit ea5c188

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

automq_byoc_role_policy.json renamed to automq_byoc_role_policy.json.tpl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@
100100
"s3:ListBucket"
101101
],
102102
"Resource": [
103-
"arn:aws:s3:::${local.automq_data_bucket}",
104-
"arn:aws:s3:::${local.automq_ops_bucket}"
103+
"arn:aws:s3:::${automq_data_bucket}",
104+
"arn:aws:s3:::${automq_ops_bucket}"
105105
]
106106
},
107107
{
@@ -114,8 +114,8 @@
114114
"s3:DeleteObject"
115115
],
116116
"Resource": [
117-
"arn:aws:s3:::${local.automq_data_bucket}/*",
118-
"arn:aws:s3:::${local.automq_ops_bucket}/*"
117+
"arn:aws:s3:::${automq_data_bucket}/*",
118+
"arn:aws:s3:::${automq_ops_bucket}/*"
119119
]
120120
}
121121
]

main.tf

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,10 @@ resource "aws_iam_policy" "automq_byoc_policy" {
175175
name = "automq-byoc-service-policy-${var.automq_byoc_env_id}"
176176
description = "Custom policy for automq_byoc service"
177177

178-
policy = file("${path.module}/automq_byoc_role_policy.json")
178+
policy = templatefile("${path.module}/automq_byoc_role_policy.json.tpl", {
179+
automq_data_bucket = local.automq_data_bucket
180+
automq_ops_bucket = local.automq_ops_bucket
181+
})
179182
}
180183

181184
resource "aws_iam_role_policy_attachment" "automq_byoc_role_attachment" {

0 commit comments

Comments
 (0)