DbSubnetGroup stack already exists (CloudFormation Stack issue)

0

Hello, I am trying to deploy using serverless, I had an exisiting stack which got deleted and upon redeploying, the code is now giving error on DBSubnet sThe DB subnet group 'asdsdafdsf' already exists. THe DBSubnet is not part of the current successful deployemnt in the resources, but if added it throws the error it exists. How can i fix it.

1回答
0

If that subnet group is not required, update the cloudformation stack again by changing the logical id and name of the subnet group in the template.

This way new subnet group would be created and used in database.

Note: Cloudformation first creates the resources and then delete the missing one from change set. In your case, it's trying to create one with same name, which is why you are stuck.

Additional context: If database was created through cloudfromation and set to retain, then even if cloudfromation stack gets deleted, default subnet group would also be retained as it can't be detached from DB, since it's default one. So you may want to create a new one or make sure DB provisioned from previously deployed template is also wiped off and then you can deploy this stack without any change. I hope this is non-production environment where you can provision resources again after deleting them.

Hope this helps.

Abhishek

profile pictureAWS
エキスパート
回答済み 10ヶ月前
  • Do you have any questions further, happy to help.

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ