JavaDeveloper
JavaDeveloper

Reputation: 5660

How to enforce terraform destroy?

terraform destroy -var-file='filename' 

**Do you really want to destroy?**

  Terraform will delete all your managed infrastructure.
  There is no undo. Only 'yes' will be accepted to confirm.

However, I want to change the command such that it will destroy without asking the question Do you really want to destroy? So what argument should I provide it ?

Upvotes: 9

Views: 40228

Answers (1)

Conor Mongey
Conor Mongey

Reputation: 1237

terraform destroy -auto-approve

From the docs:

This [destroy] command accepts all the arguments and flags that the apply command accepts, with the exception of a plan file argument.

If -auto-approve is set, then the destroy confirmation will not be shown.

Upvotes: 30

Related Questions