HashiCorpHashiCorp
TA-002-P · Question #121
TA-002-P Question #121: Real Exam Question with Answer & Explanation
The correct answer is A: Create an execution plan by evaluating the difference between configuration file and state. The terraform plan command generates an execution plan by comparing the desired state in configuration files with the current state of infrastructure.
Use the Terraform CLI (terraform plan, apply, destroy, fmt, init, validate, workspace, import, taint, providers, output)
Question
What does terrafom plan do ?
Options
- ACreate an execution plan by evaluating the difference between configuration file and state
- BPerforms a refresh, unless explicitly disabled, and then apply the changes that are
- CCreate an execution plan by evaluating the difference between configuration file and
- DChecks whether the execution plan for a set of changes matches your expectations by
Explanation
The terraform plan command generates an execution plan by comparing the desired state in configuration files with the current state of infrastructure.
Common mistakes.
- B. This describes the behavior of
terraform apply, which performs changes after an optional refresh, notterraform plan. - C. This option is incomplete as it correctly identifies the configuration file but omits the crucial comparison with the state file.
- D. While
terraform planhelps in checking expectations, its primary function is to generate the detailed execution plan, not just to verify expectations.
Concept tested. terraform plan command functionality
Reference. https://developer.hashicorp.com/terraform/cli/commands/plan
Topics
#terraform plan#execution plan#Terraform CLI#state file
Community Discussion
No community discussion yet for this question.