TERRAFORM-ASSOCIATE-004 · Question #266
When running a terraform plan, how can you save the plan so it can be applied at a later time?
The correct answer is D. use the -out parameter. To save a Terraform plan for later application, you must specify an output file when generating the plan.
Question
Options
- Ayou cannot save a plan
- Buse the -file parameter
- Cuse the -save parameter
- Duse the -out parameter
How the community answered
(65 responses)- A3% (2)
- B5% (3)
- C2% (1)
- D91% (59)
Why each option
To save a Terraform plan for later application, you must specify an output file when generating the plan.
Terraform explicitly supports saving plans for later application, making this statement incorrect.
The `-file` parameter is not a valid or recognized option for the `terraform plan` command to save an execution plan.
The `-save` parameter is not a recognized or valid option for the `terraform plan` command to save the execution plan.
The `terraform plan -out=<filename>` command saves the generated execution plan to a specified file. This saved plan file contains a binary representation of the proposed infrastructure changes, ensuring that the exact same plan can be applied later using `terraform apply <filename>`.
Concept tested: Saving Terraform execution plans
Source: https://developer.hashicorp.com/terraform/cli/commands/plan#saving-a-plan-to-a-file
Topics
Community Discussion
No community discussion yet for this question.