Repository navigation
|
I want a failed apply to not leave a paid GPU pod running. What is the pattern to guarantee teardown? |
Answered by
iacker
Jul 10, 2026
Replies: 1 comment
|
Do not rely on apply rollback (it does not destroy created resources). Instead wrap the workflow: run terraform apply, and on any non-zero exit run terraform destroy -auto-approve in a trap/finally. Combine with a provider-level timeout and a budget guard that polls pod uptime and force-destroys past a threshold. The idempotent destroy is what actually stops the billing, not apply semantics. |
0 replies
Answer selected by
iacker
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Do not rely on apply rollback (it does not destroy created resources). Instead wrap the workflow: run terraform apply, and on any non-zero exit run terraform destroy -auto-approve in a trap/finally. Combine with a provider-level timeout and a budget guard that polls pod uptime and force-destroys past a threshold. The idempotent destroy is what actually stops the billing, not apply semantics.