nerdexam
HashiCorp

TA-002-P · Question #67

How can terraform plan aid in the development process?

The correct answer is A. Validates your expectations against the execution plan without permanently modifying. The 'terraform plan' command helps in development by showing a preview of the changes Terraform will make to infrastructure without actually applying them, allowing validation of configuration before deployment.

Use the Terraform CLI (terraform plan, apply, destroy, fmt, init, validate, workspace, import, taint, providers, output)

Question

How can terraform plan aid in the development process?

Options

  • AValidates your expectations against the execution plan without permanently modifying
  • BInitializes your working directory containing your Terraform configuration files
  • CFormats your Terraform configuration files
  • DReconciles Terraform's state against deployed resources and permanently modifies state

How the community answered

(20 responses)
  • A
    90% (18)
  • B
    5% (1)
  • C
    5% (1)

Why each option

The 'terraform plan' command helps in development by showing a preview of the changes Terraform will make to infrastructure without actually applying them, allowing validation of configuration before deployment.

AValidates your expectations against the execution plan without permanently modifyingCorrect

'terraform plan' is crucial for development as it generates an execution plan detailing what actions (create, update, destroy) Terraform will perform to reach the desired state defined in the configuration, without making any actual changes to the real infrastructure. This allows developers to verify their configuration and anticipate potential issues.

BInitializes your working directory containing your Terraform configuration files

'terraform init' initializes the working directory, downloads providers, and sets up backend configuration.

CFormats your Terraform configuration files

'terraform fmt' formats Terraform configuration files to a canonical style.

DReconciles Terraform's state against deployed resources and permanently modifies state

'terraform refresh' reconciles state, and 'terraform apply' modifies state and infrastructure; 'plan' does not permanently modify.

Concept tested: Terraform plan command purpose

Source: https://developer.hashicorp.com/terraform/cli/commands/plan

Topics

#terraform plan#execution plan#CLI#validation

Community Discussion

No community discussion yet for this question.

Full TA-002-P Practice