0
0
Terraformcloud~5 mins

Auto-approve flag and its danger in Terraform - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does the -auto-approve flag do in Terraform?
The -auto-approve flag skips the manual approval step and applies changes immediately without asking for confirmation.
Click to reveal answer
beginner
Why can using -auto-approve be dangerous?
Because it applies changes without review, it can cause unintended infrastructure changes or outages if mistakes are present in the configuration.
Click to reveal answer
beginner
What is a safer alternative to using -auto-approve?
Review the plan output manually and run terraform apply without -auto-approve to confirm changes before applying.
Click to reveal answer
intermediate
In what situations might -auto-approve be acceptable?
In automated pipelines where changes are small, tested, and reviewed beforehand, and quick deployment is needed without manual steps.
Click to reveal answer
intermediate
How can teams reduce risks when using -auto-approve in Terraform?
By implementing code reviews, automated tests, and approval gates before the apply step, even if -auto-approve is used in automation.
Click to reveal answer
What happens when you run terraform apply -auto-approve?
ATerraform only shows the plan but does not apply changes.
BTerraform applies changes immediately without asking for confirmation.
CTerraform asks twice for confirmation before applying.
DTerraform cancels the apply process.
Why is it risky to use -auto-approve in production environments?
AIt requires manual approval every time.
BIt slows down the deployment process.
CIt disables Terraform logging.
DIt can cause unexpected infrastructure changes without review.
Which practice helps reduce risks when using -auto-approve?
ARunning automated tests and code reviews before apply.
BSkipping the plan step entirely.
CApplying changes without any prior checks.
DUsing <code>-auto-approve</code> only on local machines.
When might using -auto-approve be acceptable?
AIn automated pipelines with tested and reviewed changes.
BWhen making large untested changes in production.
CWhen you want to avoid writing Terraform plans.
DWhen you want to disable Terraform state locking.
What does Terraform normally do before applying changes without -auto-approve?
ASkips the plan step.
BApplies changes immediately.
CShows a plan and asks for manual confirmation.
DDeletes the state file.
Explain what the -auto-approve flag does in Terraform and why it can be dangerous.
Think about what happens when you don't get a chance to review changes.
You got /4 concepts.
    Describe best practices to safely use -auto-approve in automated Terraform workflows.
    Consider how teams can prevent mistakes before applying changes automatically.
    You got /4 concepts.