Skip to content

Instantly share code, notes, and snippets.

@ajbrown
Created June 8, 2014 17:04
Show Gist options
  • Save ajbrown/9bfe5be249e7714b5790 to your computer and use it in GitHub Desktop.
Save ajbrown/9bfe5be249e7714b5790 to your computer and use it in GitHub Desktop.
AWS Permissions Policy template allwoing SNS topic to sendMessage to SQS queue
/**
* The following permission policy will allow an SNS topic to send messages to an SQS queue. Note that
* the value of "aws:SourceArn" can contain wildcards, so you could allow all topics in your account
* access to the queue, or topics that share a prefix (for example).
*
* Add this policy by clicking "Edit Policy Document" in the "Permissions" tab when viewing a queue
* in the AWS management console.
*/
{
"Version": "2008-10-17",
"Id": "arn:aws:sqs:us-west-1:01234567890:my-awesome-sqs-queue/SQSDefaultPolicy",
"Statement": [
{
"Sid": "",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Action": "SQS:SendMessage",
"Resource": "arn:aws:sqs:us-west-1:01234567890:my-awesome-sqs-queue",
"Condition": {
"StringLike": {
"aws:SourceArn": "arn:aws:sns:us-west-1:01234567890:my-average-sns-topic"
}
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment