hashicorp / hashicorp/terraform-exec
Support -destroy option for terraform apply >= Terraform CLI 0.15
Open
- Dominant language
- Go
- Stars
- 786
- Forks
- 129
- PR merge metrics
- No merged PRs in 30d
Description
Post Terraform CLI 0.15, `terraform apply -destroy` can be used in place of `terraform destroy`. This issue proposes allowing the `DestroyFlagOption` to be passed to `(tf *Terraform) Apply` to replicate this direct terraform CLI usage behavior.
Proposal
Implement the ApplyOption interface for the DestroyFlagOption
Add the `-destroy` flag to the `(tf *Terraform) Apply` unit test
Add an e2e test which replicates [`TestDestroy`](https://github.com/hashicorp/terraform-exec/blob/6861367e4afcc6efd7b587875487250fd5a66fcc/tfexec/internal/e2etest/destroy_test.go#L12-L29) using the new functionality
Contributor guide
Assessment
This issue has not been assessed yet.