Creating an Amazon SQS queue using AWS CloudFormation
You can use the AWS CloudFormation console and a JSON (or YAML) template to create an Amazon SQS queue. For
more information, see Working with AWS CloudFormation
Templates and the AWS::SQS::Queue
Resource in the
AWS CloudFormation User Guide.
To use AWS CloudFormation to create an Amazon SQS queue.
-
Copy the following JSON code to a file named
MyQueue.json
. To create a standard queue, omit theFifoQueue
andContentBasedDeduplication
properties. For more information on content-based deduplication, see Exactly-once processing in Amazon SQS.Note
The name of a FIFO queue must end with the
.fifo
suffix.{ "AWSTemplateFormatVersion": "2010-09-09", "Resources": { "MyQueue": { "Properties": { "QueueName": "MyQueue.fifo", "FifoQueue": true, "ContentBasedDeduplication": true }, "Type": "AWS::SQS::Queue" } }, "Outputs": { "QueueName": { "Description": "The name of the queue", "Value": { "Fn::GetAtt": [ "MyQueue", "QueueName" ] } }, "QueueURL": { "Description": "The URL of the queue", "Value": { "Ref": "MyQueue" } }, "QueueARN": { "Description": "The ARN of the queue", "Value": { "Fn::GetAtt": [ "MyQueue", "Arn" ] } } } }
-
Sign in to the AWS CloudFormation console
, and then choose Create Stack. -
On the Specify Template panel, choose Upload a template file, choose your
MyQueue.json
file, and then choose Next. -
On the Specify Details page, type
MyQueue
for Stack Name, and then choose Next. -
On the Options page, choose Next.
-
On the Review page, choose Create.
AWS CloudFormation begins to create the
MyQueue
stack and displays the CREATE_IN_PROGRESS status. When the process is complete, AWS CloudFormation displays the CREATE_COMPLETE status. -
(Optional) To display the name, URL, and ARN of the queue, choose the name of the stack and then on the next page expand the Outputs section.