11.08.2017 Views

sqs-dg-2009-02-01

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

Shared Queues<br />

Shared Queues<br />

Topics<br />

• Simple API for Shared Queues (p. 29)<br />

• Advanced API for Shared Queues (p. 29)<br />

• Understanding Permissions (p. 29)<br />

• Granting Anonymous Access to a Queue (p. 30)<br />

Amazon SQS includes methods to share your queues so others can use them, using permissions set in<br />

an access control policy. A permission gives access to another person to use your queue in some particular<br />

way. A policy is the actual document that contains the permissions you've granted.<br />

Amazon SQS offers two methods for setting a policy: a simple API and an advanced API. In the simple<br />

API, SQS generates an access control policy for you. In the advanced API, you create the access control<br />

policy.<br />

Simple API for Shared Queues<br />

The simple API for sharing a queue has two operations:<br />

• AddPermission<br />

• RemovePermission<br />

With the Simple API, Amazon SQS writes the policy in the required language for you based on the<br />

information you include in the AddPermission operation. However, the policy that Amazon SQS generates<br />

is limited in scope. You can grant permissions to principals, but you can't specify restrictions.<br />

Advanced API for Shared Queues<br />

With the advanced API, you write the policy yourself directly in the access policy language and upload<br />

the policy with the SetQueueAttributes operation. The advanced API allows you to deny access or to<br />

apply finer access restrictions (for example, based on time or based on IP address).<br />

If you choose to write your own policies, you need to understand how policies are structured. For complete<br />

reference information about policies, see Using The Access Policy Language (p. 32). For examples of<br />

policies, see Amazon SQS Policy Examples (p. 57).<br />

Understanding Permissions<br />

A permission is the type of access you give to a principal (the user receiving the permission). You give<br />

each permission a label that identifies that permission. If you want to delete that permission in the future,<br />

you use that label to identify the permission. If you want to see what permissions are on a queue, use<br />

the GetQueueAttributes operation. Amazon SQS returns the entire policy (containing all the permissions).<br />

Amazon SQS supports the permission types shown in the following table.<br />

Permission<br />

*<br />

ReceiveMessage<br />

Description<br />

This permission type grants the following actions to a principal on a shared<br />

queue: receive messages, send messages, delete messages, change a<br />

message's visibility, get a queue's attributes.<br />

This grants permission to receive messages in the queue.<br />

API Version <strong>2009</strong>-<strong>02</strong>-<strong>01</strong><br />

29

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

Saved successfully!

Ooh no, something went wrong!