Skip to content

Commit 18770dd

Browse files
author
Sean Dawson
authored
Merge pull request #50 from danielnixon/patch-1
Use raw ARN to avoid cyclic dependency
2 parents 88a433f + f16ab09 commit 18770dd

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/serverless-sns-sqs-lambda.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ Usage
302302
* @param {object} template the template which gets mutated
303303
* @param {{name}} config the name of the queue the lambda is subscribed to
304304
*/
305-
addLambdaSqsPermissions(template, { name }) {
305+
addLambdaSqsPermissions(template, { name, prefix }) {
306306
template.Resources.IamRoleLambdaExecution.Properties.Policies[0].PolicyDocument.Statement.push(
307307
{
308308
Effect: "Allow",
@@ -312,9 +312,8 @@ Usage
312312
"sqs:GetQueueAttributes"
313313
],
314314
Resource: [
315-
{
316-
"Fn::GetAtt": [`${name}Queue`, "Arn"]
317-
}
315+
`arn:aws:sqs:#{AWS::Region}:#{AWS::AccountId}:${prefix}${name}Queue`,
316+
`arn:aws:sqs:#{AWS::Region}:#{AWS::AccountId}:${prefix}${name}DeadLetterQueue`
318317
]
319318
}
320319
);

0 commit comments

Comments
 (0)