Creating an Amazon SQS queue using AWS CloudFormation - Amazon Simple Queue Service

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.
  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 AWS 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.

    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.

    The AWS 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.