-
-
Notifications
You must be signed in to change notification settings - Fork 167
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
terraform destroy needs explanation #44
Comments
@schollii you're right, this should be documented somewhere. Right now it's not. Please have a look here for some of the scripts we've used in the past: https://github.com/cloudposse/terraform-root-modules/tree/master/aws/tfstate-backend/scripts |
Thanks that's useful to know. It could be useful to mention the scripts in the docs, but also the procedure I mentioned, in case the scripts are not adequate for whatever reason. |
So the trick of using the module's support for automatically generating a backend.tf file works really nicely and simplifies the destruction. Here is what I use. Creation
Then this is needed only once:
Since this is only once I put all these in a script Once the above is done you can define more resources and terraform apply as needed. Deletion
I put all the above in a |
Excellent. Thank you. Could you put your scripts in a comment for reference? Then I'll rewrite my doc. |
I think this cam be closed. Nice working with you, @schollii. |
likewise @jmcgeheeiv thanks for contributing the solution in #46 |
Found a bug? Maybe our Slack Community can help.
Describe the Bug
The module docs should explain how to cleanup.
Expected Behavior
The module docs would say something like (I'm still confirming the details but I just don't want to loose this issue report):
Destroy
terraform init
force_destroy=true
to yourterraform_state_backend
thenterraform apply
terraform destroy
Warning: while the state is local, the state in the bucket still exists, others (or CI/CD!) should not modify it.
The text was updated successfully, but these errors were encountered: