-
Notifications
You must be signed in to change notification settings - Fork 38
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
Add a retain option for making destroy a no-op #33
base: master
Are you sure you want to change the base?
Conversation
It's worthwhile pointing out there is some prior art on using these types of variables on resources https://www.terraform.io/docs/providers/aws/r/route53_zone.html#force_destroy |
I understand the desired behavior for a dns zone which can contains other records managed outside of terraform. For a single environment variable, I'm less sure it is useful. To do that, you can remove its declaration from your terraform sourcecode and do a As far as I understand your code, doing a Can you provide a bit more info about use case where you don't want to clear out env vars when the resources is destroyed ? |
For our particular use case we have a single environment managed ~3800 pairs CircleCI environment variables, i.e. ~7600 individual resources. Each resource is not individually instantiated, but defined in a standard module for publishing permissions that is invoked many times. Each invocation can take Our problem comes around when you move a Circle project from one module to another; there is no way to carry the reference across. This means we get a race condition where Terraform tries to "create" an environment variable that is already there before the delete has taken place. For reference the workspace/repo that manages these resources is updated 50+ times a week and changes to Circle projects are consider something that requires no human interaction to approve that PR. Sadly, that means we can't and won't be doing state file surgery to move the projects around |
I'm not sure I understand how #32 you in that case: it adds retries on creation but it still checks for variable existence before trying to create it. |
We've encountered some scenarios where we don't actually want to clear out environment variables when the resource is destroyed.