sqs-consumer
sqs-consumer copied to clipboard
Docs Missing Required IAM Permission
Describe the problem
The README should include the sqs:ChangeMessageVisibility
IAM permission. This permission is used by the following lines of code:
- https://github.com/bbc/sqs-consumer/blob/v5.6.0/src/consumer.ts#L279
- https://github.com/bbc/sqs-consumer/blob/v5.6.0/src/consumer.ts#L401
To Reproduce
Steps to reproduce the behaviour:
- Assume an IAM role that has the
sqs:ReceiveMessage
andsqs:DeleteMessage
permissions for the relevant SQS queue, but not thesqs:ChangeMessageVisibility
permission. - Write code that creates a consumer for the SQS queue. Include a heartbeat interval and a handler that takes longer than that interval to complete (e.g. 30 second interval and handler that sleeps for a minute).
- Add a message to the queue.
- Run the code and observe the following error message on the heartbeat interval:
AccessDenied: Access to the resource https://sqs.<region>.amazonaws.com/ is denied.
Expected behaviour
The error is expected, you just need to add the sqs:ChangeMessageVisibility
IAM permission.