Deleting stacks with retained resources leads to IaC generator erroneously marking them as "Managed by a stack"

0

Problem:

Very possible that this is user error, but I've been attempting to migrate some existing resources into stacks (and from there to being managed through the CDK) and during the course of this process I've imported some resources into a stack that failed to create. I deleted the stack then attempted to recreate it and the resources are now marked as "Managed by a stack" and are not selectable in the IaC generator any longer.

Things I've tried:

  1. I thought maybe there was a time-related propagation issue so I waited a few days to see if they would become selectable again after the stack deletion had some time to propagate. This did not work.
  2. I thought maybe the "Managed by stack" tag on resources would update if I attempted to create a new stack with other resources. This resulted in the same scenario as before (stack failed to create and I deleted it) and now even more resources are locked.

Possible Solution:

I've found that if I manually create the CFN template for a resource, I can still get it into a stack by "Create New Stack -> With Existing Resources". However, because I can't use the IaC generator this would involve manually writing the CFN template including all of the existing resources which is a lot of manual work. Hoping for a way to unblock the IaC generator to avoid this.

Kengel
已提問 1 個月前檢視次數 122 次
1 個回答
-1

There are different things you can try to fix this situation, starting from deleting the stack set completely using the aws cloudformation delete-stack-set command. This will remove any associations between the resources and the failed stack.

Or you can import the existing AWS resources in IAc like this: https://repost.aws/knowledge-center/cfn-best-practices-for-importing-resources

profile picture
專家
已回答 1 個月前
  • I don't have any existing stack sets and it doesn't look like there are any instructions for actually importing the resources in that link. It's a bunch of best practices that are helpful sure, but I'm trying to unblock my resources from me being able to use the IaC generator to get the template I can use to import them. The link doesn't seem to have anything to do with that.

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

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

回答問題指南