25.02.2020 Views

sqs-m5

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Amazon Simple Queue Service Developer Guide<br />

Amazon SQS Policy Examples<br />

Amazon SQS Policy Examples<br />

This section shows example policies for common Amazon SQS use cases.<br />

The following example policy gives the developer with AWS account number 123456789012 the<br />

SendMessage permission for the queue named 987654321098/queue1.<br />

{<br />

}<br />

"Version": "2008-10-17",<br />

"Id": "Queue1_Policy_UUID",<br />

"Statement":<br />

{<br />

"Sid":"Queue1_SendMessage",<br />

"Effect": "Allow",<br />

"Principal": {<br />

"AWS": "123456789012"<br />

},<br />

"Action": "<strong>sqs</strong>:SendMessage",<br />

"Resource": "/987654321098/queue1"<br />

}<br />

The following example policy gives the developer with AWS account number 123456789012 both the<br />

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

{<br />

}<br />

"Version": "2008-10-17",<br />

"Id": "Queue1_Policy_UUID",<br />

"Statement":<br />

{<br />

"Sid":"Queue1_Send_Receive",<br />

"Effect": "Allow",<br />

"Principal": {<br />

"AWS": "123456789012"<br />

},<br />

"Action": ["<strong>sqs</strong>:SendMessage","<strong>sqs</strong>:ReceiveMessage"],<br />

"Resource": "/987654321098/queue1"<br />

}<br />

The following example policy gives two different developers (with AWS account numbers 123456789012<br />

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

987654321098/queue1.<br />

{<br />

"Version": "2008-10-17",<br />

"Id": "Queue1_Policy_UUID",<br />

"Statement":<br />

{<br />

"Sid":"Queue1_AllActions",<br />

"Effect": "Allow",<br />

"Principal": {<br />

"AWS": ["123456789012","555566667777"]<br />

},<br />

"Action": "<strong>sqs</strong>:*",<br />

API Version 2009-02-01<br />

57

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

Saved successfully!

Ooh no, something went wrong!