I have 2 workspaces (workspace_a
→ workspace_b
) in TFC that I plan/apply and destroy as part of GitHub Actions pipeline.
workspace_b
uses remote state from workspace_a
:
data.terraform_remote_state.workspace_a.outputs.location
First time I run the destroy pipeline: destroy workspace_b
followed by destroy workspace_a
everything is fine.
However if I re-run the destroy pipeline it fails because terraform cannot lookup the remote state of workspace_a
.
What’s the best way to make the pipeline Idempotent so we can re-run destroy without data.terraform_remote_state
failing?