nerdexam
HashiCorp

TA-002-P · Question #121

What does terrafom plan do ?

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

How the community answered

(32 responses)
  • A
    88% (28)
  • B
    3% (1)
  • C
    3% (1)
  • D
    6% (2)

Why each option

The `terraform plan` command generates an execution plan by comparing the desired state in configuration files with the current state of infrastructure.

ACreate an execution plan by evaluating the difference between configuration file and stateCorrect

`terraform plan` creates an execution plan by evaluating the difference between the current infrastructure state, as recorded in the state file, and the desired state defined in the Terraform configuration files. This plan shows what actions (create, update, delete) Terraform proposes to take without actually performing them.

BPerforms a refresh, unless explicitly disabled, and then apply the changes that are

This describes the behavior of `terraform apply`, which performs changes after an optional refresh, not `terraform plan`.

CCreate an execution plan by evaluating the difference between configuration file and

This option is incomplete as it correctly identifies the configuration file but omits the crucial comparison with the state file.

DChecks whether the execution plan for a set of changes matches your expectations by

While `terraform plan` helps in checking expectations, its primary function is to generate the detailed execution plan, not just to verify expectations.

Concept tested: `terraform plan` command functionality

Source: 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.

Full TA-002-P Practice