0

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.

RAVIBHARATHI PK
  • 91
  • 1
  • 13

1 Answers1

0

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

omuthu
  • 5,948
  • 1
  • 27
  • 37
  • do we need leave the queue name empty i.e(QueueName:""), does that make a new queue every time run a code pipeline? then how could we find the queue name to trigger in lambda function? @omuthu – RAVIBHARATHI PK Oct 03 '19 at 15:18
  • no,whenever there is a need to update SQS, it will safely replace a new queue and it will use EventSourceArn of SQS in EventSourceMapping template and will get updated accordingly. https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html – omuthu Oct 03 '19 at 17:26