Question

Is it possible to create a queue with a specific name via cloudFormation? I assumed so, becouse it's possible to choose a name when I create the queue via UI or java API, but I couldn't find a way to do this with cloudFormation.

Was it helpful?

Solution

Amazon have just released the ability to do this in Cloudformation via user defined names. An example queue name template is defined where you add a new properties QueueName to the properties of the queue - for example

Resources: {
    MyQueue: {
        Type: "AWS::SQS::Queue",
        Properties: {
            QueueName: {"MyOwnQueueName"}
        }
    }
}

OTHER TIPS

here is a sample template for the cloudformation docs:

https://s3.amazonaws.com/cloudformation-templates-us-east-1/SQS.template

and here the docs for the corresponding AWS::SQS::Queue object: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sqs-queues.html

to make it more clear:

"Resources" : {
    "The Name of your queue" : {
        "Type" : "AWS::SQS::Queue"
   }
},

The final name of the queue will be:

{stack name}-{the name you specified for the queue}-{some random hash?}

not sure about the last part.
for example if you name you stack testStack and your queue testQueueName you will end up with something like this:
testStack-testQueueName-1PTTUS9YD37S5

however, you should maybe not relay on some suffixes or prefixes, you can get the queue names in the template and write it to a file with in the same cloudformation template

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top