HashiCorp Terraform Associate (004) exam dumps

HashiCorp Terraform Associate (004) practice question 47 of 223

Terraform Associate 004. Associate level, HashiCorp. Free question with the correct answer and a full explanation.

HashiCorp Terraform Associate (004) Question 47

Single answer3 Core Terraform workflow

A team stores its Terraform configuration in Git and uses a remote backend for state. A platform engineer updates several .tf files to add tags to existing AWS resources and opens a pull request. Before merging, the team wants a repeatable workflow that lets reviewers see exactly what infrastructure changes Terraform intends to make, without applying anything yet. Which command should the engineer run after terraform init to generate the most appropriate reviewable output for this stage of the workflow?

  1. A

    terraform apply

  2. B

    terraform validate

  3. C

    terraform plan

  4. D

    terraform refresh

Show answer and explanation

Correct answer: C

Explanation

In the core Terraform workflow, the typical sequence is terraform init, then terraform plan, and finally terraform apply after approval. For pull request or pre-deployment review, terraform plan is the correct command because it shows the proposed actions, create, update, or destroy, without making changes. terraform validate only checks configuration validity, while terraform apply would attempt to change infrastructure. HashiCorp documentation describes plan as the step used to preview changes before applying them, which makes it the correct choice for a repeatable and reviewable workflow.

  • A. Incorrect.

    terraform apply is incorrect because it does more than show intended changes; it attempts to execute them. In a pull request review stage, the team wants to inspect proposed changes before modifying real infrastructure. Although apply includes a planning step, it is not the safest or most appropriate command when the goal is review only.

  • B. Incorrect.

    terraform validate is incorrect because it checks whether the configuration is syntactically valid and internally consistent, but it does not compare the configuration to the current state and remote infrastructure to show proposed changes. It is useful in CI, but it does not produce the change preview reviewers need.

  • C. Correct.

    terraform plan is correct because it creates an execution plan showing what Terraform will do to reconcile the current infrastructure with the updated configuration. This is the standard command used in the core Terraform workflow after initialization when teams want to review intended changes before running terraform apply.

  • D. Incorrect.

    terraform refresh is incorrect because its purpose was to reconcile state with real infrastructure, not to provide the primary review artifact for proposed configuration changes. It does not serve the same role as terraform plan in a review workflow, and modern workflows generally rely on planning and normal state refresh behavior during plan/apply rather than using refresh as the review step.

Timed practice exam

Take a HashiCorp Terraform Associate (004) practice test under exam conditions

70 questions in 60 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam