'Could not create aws sqs queue for multiple environment?

The yml file in aws sqs has Resources: MyQueue: Type: AWS::SQS::Queue Properties: QueueName:"mytestqueue"

how to handle the MYQueue when creating a stage environment, it is throwing Queue already exists!

how to add MyQueue to stage in template.yml file.



Solution 1:[1]

Please read these article to get learn about amazon sqs queues and to implement :

  1. https://hydroid.medium.com/aws-sqs-simple-queue-service-14699b8cca7f
  2. https://hydroid.medium.com/create-get-amazon-sqs-queues-8d9c5381f3e2

Solution 2:[2]

It is better to ignore naming the resources manually, you can't perform updates on such resources. Let the service create the name which can help you with updates.

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sqs-queues.html#aws-sqs-queue-name

"If you specify a name, you can't perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name."

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Anushil Kumar
Solution 2 omuthu