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.

已提問 10 個月前檢視次數 326 次
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.

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南