File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
terraform/modules/lambdas Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -119,7 +119,7 @@ resource "aws_iam_policy" "api_only_policy" {
119119 Effect = " Allow" ,
120120 Action = [" sqs:SendMessage" ],
121121 Resource = [
122- " arn:aws:sqs:${ data . aws_region . current . name } :${ data . aws_caller_identity . current . account_id } :infra-core-api -*" ,
122+ " arn:aws:sqs:${ data . aws_region . current . name } :${ data . aws_caller_identity . current . account_id } :${ var . ProjectId } -*" ,
123123 ]
124124 }
125125 ]
@@ -294,8 +294,9 @@ resource "aws_iam_policy" "shared_iam_policy" {
294294}
295295
296296resource "aws_iam_role_policy_attachment" "api_attach" {
297+ for_each = toset ([aws_iam_policy . shared_iam_policy . arn , aws_iam_policy . api_only_policy . arn ])
297298 role = aws_iam_role. api_role . name
298- policy_arn = aws_iam_policy . shared_iam_policy . arn
299+ policy_arn = each . key
299300}
300301
301302resource "aws_iam_role_policy_attachment" "entra_attach" {
You can’t perform that action at this time.
0 commit comments