Skip to content

Best Practice to Remove Resources? #75

Discussion options

You must be logged in to vote

That behavior is expected — deleting code or reverting a PR doesn’t affect the Terraform state, so resources won’t be destroyed unless explicitly handled. Destroying resources can be risky and non-trivial, so it’s best to make the process intentional and traceable.

The recommended approach is to use the enabled variable built into all Cloud Posse modules and components. By setting enabled: false for a given component in a PR, you tell Terraform to remove all resources from state and therefore destroy all associated resources on the next apply. This provides an auditable way to deprovision infrastructure that we can trace through pull requests. Keep in mind, however, that this method doesn…

Replies: 1 comment 1 reply

Comment options

milldr
May 28, 2025
Maintainer Sponsor

You must be logged in to vote
1 reply
@osterman
Comment options

Answer selected by dukarc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants