Creating an Amazon SQS queue using Amazon CloudFormation - Amazon Simple Queue Service
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 (PDF).

Creating an Amazon SQS queue using Amazon CloudFormation

You can use the Amazon CloudFormation console and a JSON (or YAML) template to create an Amazon SQS queue. For more information, see Working with Amazon CloudFormation Templates and the AWS::SQS::Queue Resource in the Amazon CloudFormation User Guide.

To use Amazon CloudFormation to create an Amazon SQS queue.
  1. Copy the following JSON code to a file named MyQueue.json. To create a standard queue, omit the FifoQueue and ContentBasedDeduplication 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" ] } } } }
  2. Sign in to the Amazon CloudFormation console, and then choose Create Stack.

  3. On the Specify Template panel, choose Upload a template file, choose your MyQueue.json file, and then choose Next.

  4. On the Specify Details page, type MyQueue for Stack Name, and then choose Next.

  5. On the Options page, choose Next.

  6. On the Review page, choose Create.

    Amazon CloudFormation begins to create the MyQueue stack and displays the CREATE_IN_PROGRESS status. When the process is complete, Amazon CloudFormation displays the CREATE_COMPLETE status.

    The Amazon CloudFormation console displaying the CREATE_COMPLETE status.
  7. (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.