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
asked 13 days ago107 views
1 Answer
-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
EXPERT
answered 13 days ago
  • 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.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions