-auto-approve
The option that makes apply or destroy skip the yes prompt and act immediately.
It removes the final human check, so an unread plan, including a destroy, runs straight away.
In more detail
Leave the prompt on when working by hand; it is the last chance to read the plan. Pipelines that apply a reviewed, saved plan file do not need it, because applying a saved plan never prompts.
Example
terraform apply -auto-approveRelated terms
- terraform apply — The command that carries out a plan, creating, changing and deleting real infrastructure, then records the result in state.
- terraform destroy — The command that deletes every resource the current state records, in reverse dependency order.
- saved plan — A plan written to a file with -out, which terraform apply can later carry out exactly as reviewed.
Taught in
- Predicting Changes, Then Applying Them — Infrastructure as Code with Terraform
- Tearing It Down With Destroy — Infrastructure as Code with Terraform
- The Plan That Wanted To Destroy Production — HashiCorp Terraform Associate (004) Exam Prep
- Infrastructure As Code, And One Workflow For Every Platform — HashiCorp Terraform Associate (004) Exam Prep
- Versions, The Lock File And Provider Aliases — HashiCorp Terraform Associate (004) Exam Prep
- State: Terraform's Memory Of What It Built — HashiCorp Terraform Associate (004) Exam Prep
- Reading A Plan, Saving It, Applying It — HashiCorp Terraform Associate (004) Exam Prep
- Validate, Format, Destroy, And The Flags That Bend A Plan — HashiCorp Terraform Associate (004) Exam Prep
- Resources, Data Sources And The References Between Them — HashiCorp Terraform Associate (004) Exam Prep
- Input Variables, Outputs, And Which Value Wins — HashiCorp Terraform Associate (004) Exam Prep