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.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠