2013-10-06 111 views

回答

2

亞馬遜剛剛發佈了在Cloudformation中執行此操作的功能via user defined names。一個example queue name template定義,你QUEUENAME添加一個新的屬性到隊列的性能 - 例如

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

正是我需要的,謝謝! – iGili

0

這裏是爲cloudformation文檔的樣本模板:

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

這裏的文檔進行相應的AWS::SQS::Queue對象: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sqs-queues.html

,使之更加明確:

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

隊列的最終名稱將爲:

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

不確定最後一部分。
例如,如果你的名字你一疊testStack和您的隊列testQueueName你最終將像這樣的東西:
testStack-testQueueName-1PTTUS9YD37S5

但是,你也許應該不轉發一些後綴或前綴,你可以在隊列名稱該模板並將其寫入到具有相同雲模板的文件中

+0

我問以前讀過這兩個。沒有答案那裏... – iGili

+0

我編輯我的答案,使其更清楚,希望可以幫助 –

+0

謝謝,但它不完全正確。我想過使用它,只查看前綴,但我們的應用程序依賴於名稱後綴的特殊性。 – iGili