dimanche 25 mai 2014

des services web d'Amazon - créer une nouvelle file d'attente avec le nom spécifique à l'aide de cloudFormation - Stack Overflow


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.




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"}
}
}
}



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



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.



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"}
}
}
}


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


0 commentaires:

Enregistrer un commentaire