1
votes

I have a lambda function which is suppose to read message from a SQS queue and process. When I deployed everything to AWS and try to call the lambda function getting "errorMessage":"Access to the resource https://sqs.us-east-1.amazonaws.com/ is denied."

However, Lambda function can read the messages when it is run locally through Serverless Offline plugin. I have given proper permission as below. And my project is based on Serverless framework using node.js. Here is the permission block,

- Effect: Allow Action: - sqs:* Resource: - Fn::GetAtt: - NotificationQueue - Arn

1

1 Answers

0
votes

Figured out the problem that was due to improper indentation of iamRoleStatements statement. Due to that Serverless has not updated policy under lambda execution role.