AWS::SQS::QueuePolicy - Amazon CloudFormation
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China.


The AWS::SQS::QueuePolicy type applies a policy to Amazon SQS queues. For an example snippet, see Declaring an Amazon SQS policy in the Amazon CloudFormation User Guide.


To declare this entity in your Amazon CloudFormation template, use the following syntax:


{ "Type" : "AWS::SQS::QueuePolicy", "Properties" : { "PolicyDocument" : Json, "Queues" : [ String, ... ] } }


Type: AWS::SQS::QueuePolicy Properties: PolicyDocument: Json Queues: - String



A policy document that contains the permissions for the specified Amazon SQS queues. For more information about Amazon SQS policies, see Using custom policies with the Amazon SQS access policy language in the Amazon SQS Developer Guide.

Required: Yes

Type: Json

Update requires: No interruption


The URLs of the queues to which you want to add the policy. You can use the Ref function to specify an AWS::SQS::Queue resource.

Required: Yes

Type: List of String

Update requires: No interruption


Amazon SQS Queue Policy

The following sample is a queue policy that allows Amazon Web Services account 111122223333 to send and receive messages on queue queue2. You add the policy to the resources section of your template.


"SampleSQSPolicy" : { "Type" : "AWS::SQS::QueuePolicy", "Properties" : { "Queues" : [""], "PolicyDocument": { "Statement":[{ "Action":["SQS:SendMessage", "SQS:ReceiveMessage"], "Effect":"Allow", "Resource": "arn:aws:sqs:us-east-2:444455556666:queue2", "Principal": { "AWS": [ "111122223333"] } }] } } }


SampleSQSPolicy: Type: AWS::SQS::QueuePolicy Properties: Queues: - "" PolicyDocument: Statement: - Action: - "SQS:SendMessage" - "SQS:ReceiveMessage" Effect: "Allow" Resource: "arn:aws:sqs:us-east-2:444455556666:queue2" Principal: AWS: - "111122223333"