While running in a CI/CD pipeline I have experienced an oddity where “-destroy” option no longer works in conjunction of the command “terraform plan -destroy”. How to replicate:
- terraform plan -destroy -out=tfplan -input=false -lock=false
- terraform apply -input=false -auto-approve -lock=false tfplan
OR vice versa,
- terraform plan -out=tfplan -input=false -lock=false
- terraform apply -destroy -input=false -auto-approve -lock=false tfplan
Since we are utilizing the -out=tfplan, we thought this was the best option, while creating a conditional bool in our pipeline tfvars of to destroy true/false?
Is this a correct assumption per the documentation from “Planning Mode” -note midway down the page at:
That the above commands should still work. So far we are stuck on v0.15.5 otherwise. Should this be a reported bug?