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

Support 'refresh' operation #141

Closed
derjust opened this issue Feb 11, 2021 · 1 comment
Closed

Support 'refresh' operation #141

derjust opened this issue Feb 11, 2021 · 1 comment

Comments

@derjust
Copy link

derjust commented Feb 11, 2021

We use the Terraform resource type to manage all our infrastructure.
While it works great to create infrastructure, the destroy part causes some trouble.

In the end, all those issues relate around the fact that (yet) Terraform doesn't refresh its data sources during a destroy.
While is addressed in v0.15 eventually, almost all workarounds to this require the use of refresh.
For example around EKS:

It would be great to have - like plan_only - an option to let the Terraform resource refresh all it's date, and update the remote state if configured.

@ljfranklin
Copy link
Owner

I'd rather not add a workaround to the resource when the underlying issue is already fixed in the next Terraform version. As a temporary workaround, could you add a put: terraform step just before the destroy step? That way the terraform apply will refresh the state just before the destroy action.

Alternatively you can try temporarily running the destroy step with the ljfranklin/terraform-resource:rc image which contains the latest Terraform 0.15 alpha. Note that the RC images don't run through my CI pipeline, there's a chance the resource will need updated to be compatible with Terraform 0.15.

@derjust derjust closed this as completed Feb 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants