Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
SQS Policy to allow an S3 bucket to publish messages
{
"Version": "2012-10-17",
"Id": "arn:aws:sqs:YOUR-AWS-REGION:YOUR-AWS-ACCOUNT-ID:YOUR-QUEUE-NAME/SQSDefaultPolicy",
"Statement": [
{
"Sid": "example-statement-ID",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Action": "SQS:SendMessage",
"Resource": "arn:aws:sqs:YOUR-AWS-REGION:YOUR-AWS-ACCOUNT-ID:YOUR-QUEUE-NAME",
"Condition": {
"ArnLike": {
"aws:SourceArn": "arn:aws:s3:*:*:YOUR-S3-BUCKET"
}
}
}
]
}
@spicoflorin

This comment has been minimized.

Copy link

@spicoflorin spicoflorin commented May 23, 2017

Thank you very much for sharing this.

@dogenius01

This comment has been minimized.

Copy link

@dogenius01 dogenius01 commented May 31, 2018

Thank you very much for sharing this.

@Necromancerx

This comment has been minimized.

Copy link

@Necromancerx Necromancerx commented Nov 20, 2018

Thank you very much for sharing this.

@rynsantos

This comment has been minimized.

Copy link

@rynsantos rynsantos commented Dec 11, 2018

I'm just wondering if in S3 you also need to add a policy to allow it to notify the SQS? Thanks for sharing it is very helpful.

@bcpenta

This comment has been minimized.

Copy link

@bcpenta bcpenta commented Feb 14, 2019

I'm just wondering if in S3 you also need to add a policy to allow it to notify the SQS? Thanks for sharing it is very helpful.

In S3 bucket properties, you can scroll down to events, add a notification rule. and set it to SQS Queue. SO an operation you do will send a message to sqs queue.

@TheoLeanse

This comment has been minimized.

Copy link

@TheoLeanse TheoLeanse commented Aug 7, 2019

LEGEND

@m-abubakar-saddique

This comment has been minimized.

Copy link

@m-abubakar-saddique m-abubakar-saddique commented Jan 15, 2020

Thanks it helped me to solve my problem.

@ashwiniunison

This comment has been minimized.

Copy link

@ashwiniunison ashwiniunison commented Feb 5, 2020

This Solved the problem.

Thanks!!

@chuong-dao

This comment has been minimized.

Copy link

@chuong-dao chuong-dao commented Feb 11, 2020

Can we do a wildcard "aws:SourceArn": "arn:aws:s3:::bucket-name*" ? I tried and it didn't work for me. Wondering if you guys have any suggestions. I am OK with limiting even to the account level. Thanks!

@nikhilshinde57

This comment has been minimized.

Copy link

@nikhilshinde57 nikhilshinde57 commented Feb 18, 2020

Thanks Marcelo Gornstein for sharing this information it's really helpful.

@byung-u

This comment has been minimized.

Copy link

@byung-u byung-u commented Jun 26, 2020

Thank you, it's really helpful for me.

@jklacy3

This comment has been minimized.

Copy link

@jklacy3 jklacy3 commented Jul 25, 2020

hmm. can't get this to work. i created a empty S3 bucket, tried to create sqs notification action. Still getting queue permission error queue. Any ideas?

@melvinclarks

This comment has been minimized.

Copy link

@melvinclarks melvinclarks commented Oct 8, 2020

<3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment