HashiCorp Terraform Associate (004) exam dumps

HashiCorp Terraform Associate (004) practice question 21 of 223

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

HashiCorp Terraform Associate (004) Question 21

Single answer2 Terraform fundamentals

A platform team stores its Terraform configuration in Git and uses Terraform CLI in a CI pipeline. A new engineer updates an AWS VPC resource by changing only its tags and then opens a pull request. The team wants reviewers to see exactly what infrastructure Terraform intends to change before approving the merge, without making any real changes to the environment. Which Terraform command should the CI job run for this purpose?

  1. A

    terraform apply

  2. B

    terraform plan

  3. C

    terraform refresh

  4. D

    terraform validate

Show answer and explanation

Correct answer: B

Explanation

The correct answer is terraform plan. In Terraform fundamentals, plan is the command used to preview infrastructure changes before they are applied. It is especially common in CI/CD workflows because it allows teams to review the proposed actions safely. terraform apply would make real changes, which violates the requirement. terraform validate only checks configuration validity, and terraform refresh is not the correct review tool for proposed changes. HashiCorp documentation describes terraform plan as generating and showing an execution plan so you can review actions Terraform will take before applying them.

  • A. Incorrect.

    Incorrect. terraform apply creates, updates, or destroys real infrastructure to match the execution plan. While it does show a plan before applying unless auto-approve is used, it is not the right choice when the requirement is to review intended changes without modifying the environment.

  • B. Correct.

    Correct. terraform plan compares the configuration, current state, and real infrastructure information available through providers, then generates an execution plan showing what Terraform would do. This is the standard command used in pull request reviews and CI pipelines when teams want visibility into proposed changes without applying them.

  • C. Incorrect.

    Incorrect. terraform refresh updates the Terraform state to match remote infrastructure, but it is not intended as the primary review mechanism for proposed configuration changes. In modern workflows, refreshing happens as part of planning and applying. Running refresh alone does not present the same review-focused execution plan for a configuration change.

  • D. Incorrect.

    Incorrect. terraform validate checks whether the configuration is syntactically valid and internally consistent, but it does not compare configuration to state or remote infrastructure. It cannot show whether changing VPC tags will result in an in-place update, replacement, or no change.

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