Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove stacksets from an account in reverse order #178

Open
Cihl28 opened this issue Dec 6, 2023 · 2 comments
Open

Remove stacksets from an account in reverse order #178

Cihl28 opened this issue Dec 6, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@Cihl28
Copy link

Cihl28 commented Dec 6, 2023

We have a dozen or so stacksets deployed from CfCT upon account creation.
These stacksets, in some cases, depend on the presence of resources from earlier stacksets. E.g. boundary policies, KMS keys.

The problem arises when an account is removed/unmanaged, or moved to an OU which have different or fewer stacksets assigned. E.g. prior to decommissioning.
This always leads to dependency failures, because it wants to remove the stack instances in the same order in which it placed them.

We've worked around the issue, for now, by placing a lot of "DeletionPolicy: Retain" statements, which allows us to unmanage an account successfully.
But that creates another set of already exists failures when you want to add those stacks again later. We basically have to delete those resources manually first.

I'd like it if deleting stacks from an account were to happen in the reverse order as adding them.

Sounds easier said than done i must admit. You'd basically have to keep a list of stacks to remove from each account and handle that separately, or otherwise run through all the stacks again in a second pass from bottom to top for stack removal purposes.
The old AWS Landing Zone used a depends_on parameter to keep tabs on what depends on what, so things are done in the right order. But i do like the simplicity of just adding them in the order in which they appear in the manifest. Not sure if that's what makes CfCT faster than ALZ, but i wouldn't be surprised.
I'm also not sure what other problems this might cause, but i'd like to see what other perspectives on this there are.

@Cihl28 Cihl28 added the enhancement New feature or request label Dec 6, 2023
@snebhu3
Copy link

snebhu3 commented Dec 12, 2023

@Cihl28 thank you for the feature request and for the context.
We have opened an internal backlog to address this.

@RutgerBeyen
Copy link

See also #165, raised in June 2023 for the same issue/feature request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants