23.06.2023 Views

AWS

4 weeks subscription

4 weeks subscription

SHOW MORE
SHOW LESS

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 />

}<br />

}<br />

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

The following example policy gives all users ReceiveMessage permission for the queue named<br />

987654321098/queue1.<br />

{<br />

}<br />

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

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

"Statement":<br />

{<br />

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

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

"Principal": {<br />

"<strong>AWS</strong>": "*"<br />

},<br />

"Action": "sqs:ReceiveMessage",<br />

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

}<br />

The following example policy gives all users ReceiveMessage permission for the queue named<br />

987654321098/queue1, but only between noon and 3:00 p.m. on January 31, 2009.<br />

{<br />

}<br />

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

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

"Statement":<br />

{<br />

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

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

"Principal": {<br />

"<strong>AWS</strong>": "*"<br />

},<br />

"Action": "sqs:ReceiveMessage",<br />

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

"Condition" : {<br />

"DateGreaterThan" : {<br />

"aws:CurrentTime":"2009-01-31T12:00Z"<br />

},<br />

"DateLessThan" : {<br />

"aws:CurrentTime":"2009-01-31T15:00Z"<br />

}<br />

}<br />

}<br />

The following example policy gives all users permission to use all possible SQS actions that can be shared<br />

for the queue named 987654321098/queue1, but only if the request comes from the 192.168.143.0/24<br />

range.<br />

{<br />

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

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

API Version 2009-02-01<br />

58

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

Saved successfully!

Ooh no, something went wrong!