-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix permissions issues for SQS #10265
Conversation
map[string]interface{}{ | ||
"Action": []string{ | ||
"sqs:ChangeMessageVisibility", | ||
"sqs:DeleteMessage", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious: Why is this permission needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's linked to how SQS works, when you receive a batch of events from SQS you have to change the visibility of the events from visible to hidden, that visibility property has a timeout, this allows an event to be used by another workers if your initial worker crashed or something else bad happened.
When you have successfully processed the event you have to delete the event from the queue so no other worker (or function) can take it.
Now looking at the official doc
They list the following:
- sqs:ReceiveMessage
- sqs:DeleteMessage
- sqs:GetQueueAttributes
And another official doc (I can't find it) also mention sqs:ChangeMessageVisibility
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the explanation.
Correctly creates add the permission to the lambda role when monitoring SQS queue. Fixes: elastic#9152
**NOTES:** This PR is based on top of elastic#10116 Correctly add the permissions to the lambda role when monitoring SQS queue. Fixes: elastic#9152 (cherry picked from commit dc963c4)
NOTES: This PR is based on top of #10116
Correctly add the permissions to the lambda role when monitoring
SQS queue.
Fixes: #9152