Which flag would you add to terraform plan to save the execution plan to a file?

Prepare for the HashiCorp Terraform Associate Exam with quizzes, flashcards, and multiple-choice questions. Each question includes hints and explanations. Boost your confidence and ace your exam!

Multiple Choice

Which flag would you add to terraform plan to save the execution plan to a file?

Explanation:
Saving the execution plan to a file is done with the -out flag on the plan command. Running a command like terraform plan -out=plan.tfplan writes the generated plan to plan.tfplan on disk. Later, you can apply that exact plan with terraform apply plan.tfplan, which ensures the same changes are executed and avoids differences between planning and applying. If you need to peek at what's inside, you can use terraform show plan.tfplan. The other proposed flags don’t correspond to saving a plan file, so they aren’t valid choices for this purpose.

Saving the execution plan to a file is done with the -out flag on the plan command. Running a command like terraform plan -out=plan.tfplan writes the generated plan to plan.tfplan on disk. Later, you can apply that exact plan with terraform apply plan.tfplan, which ensures the same changes are executed and avoids differences between planning and applying. If you need to peek at what's inside, you can use terraform show plan.tfplan.

The other proposed flags don’t correspond to saving a plan file, so they aren’t valid choices for this purpose.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy