29.07.2020 Views

sqs-dg-2009-02-01

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Amazon Simple Queue Service Developer Guide

Amazon SQS Policy Examples

Amazon SQS Policy Examples

This section shows example policies for common Amazon SQS use cases.

The following example policy gives the developer with AWS account number 123456789012 the

SendMessage permission for the queue named 987654321098/queue1.

{

}

"Version": "2008-10-17",

"Id": "Queue1_Policy_UUID",

"Statement":

{

"Sid":"Queue1_SendMessage",

"Effect": "Allow",

"Principal": {

"AWS": "123456789012"

},

"Action": "sqs:SendMessage",

"Resource": "/987654321098/queue1"

}

The following example policy gives the developer with AWS account number 123456789012 both the

SendMessage and ReceiveMessage permission for the queue named 987654321098/queue1.

{

}

"Version": "2008-10-17",

"Id": "Queue1_Policy_UUID",

"Statement":

{

"Sid":"Queue1_Send_Receive",

"Effect": "Allow",

"Principal": {

"AWS": "123456789012"

},

"Action": ["sqs:SendMessage","sqs:ReceiveMessage"],

"Resource": "/987654321098/queue1"

}

The following example policy gives two different developers (with AWS account numbers 123456789012

and 555566667777) permission to use all actions that SQS allows shared access for the queue named

987654321098/queue1.

{

"Version": "2008-10-17",

"Id": "Queue1_Policy_UUID",

"Statement":

{

"Sid":"Queue1_AllActions",

"Effect": "Allow",

"Principal": {

"AWS": ["123456789012","555566667777"]

},

"Action": "sqs:*",

API Version 2009-02-01

57

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!