I am trying to grant access to a SQS queue thru the serverless.yml. Below is applicable part of serverless.yml granting permission (I’ve changed my id and queue name for obvious reasons). Am I formatting the arn improperly somehow?
provider:
name: aws
runtime: python3.6
iamRoleStatements:
- Effect: "Allow"
Action:
- “sqs:SendMessage”
- “sqs:GetQueueUrl”
- "sqs:ListQueues"
Resource: “arn:aws:sqs:us-east-1:000000000000:MyQueue.fifo”
If I use this wildcard resource it works without error
Resource: “arn:aws:sqs:us-east-1::”
If I use the commented wildcard Resource line instead the code works. The Python code throwing the error is:
for queue in sqs.queues.all():
print(queue.url)
The error being thrown is:
“errorMessage”: “An error occurred (AccessDenied) when calling the ListQueues operation: Access to the resource https://queue.amazonaws.com/ is denied.”,
“errorType”: “ClientError”