HashiCorp Terraform Associate (004) exam dumps

HashiCorp Terraform Associate (004) practice question 2 of 223

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

HashiCorp Terraform Associate (004) Question 2

Single answer1 Infrastructure as Code (IaC) with Terraform

A company has been creating cloud infrastructure manually through a provider console, and environments are frequently inconsistent. The platform team wants to adopt Terraform so infrastructure changes are reviewed in version control, repeatable across dev/stage/prod, and less prone to configuration drift caused by ad hoc manual changes. Which approach best reflects Terraform's Infrastructure as Code (IaC) model for this situation?

  1. A

    Define the desired infrastructure in Terraform configuration files, store them in version control, review changes through pull requests, and apply the configuration to create or update resources toward the declared end state.

  2. B

    Use Terraform only to document the current manual setup after engineers make changes in the cloud console, since Terraform is primarily a reporting tool for existing infrastructure.

  3. C

    Write shell scripts that call the cloud provider CLI for each resource change, because Terraform is not intended to manage infrastructure lifecycle after initial provisioning.

  4. D

    Run terraform apply once to create the initial environments, then continue making routine updates manually in the provider console to avoid changing Terraform configuration too often.

Show answer and explanation

Correct answer: A

Explanation

Terraform is an Infrastructure as Code tool built around a declarative workflow: you describe the desired infrastructure in configuration files, Terraform compares that desired state with the current state, shows an execution plan, and then applies the necessary changes. In practice, teams typically store Terraform code in version control and use code review processes to approve infrastructure changes before applying them. This improves consistency across environments, repeatability, auditability, and team collaboration. HashiCorp documentation emphasizes Terraform's use of declarative configuration, execution plans, and state to manage infrastructure lifecycle. In contrast, relying on manual console changes or imperative scripts increases drift and reduces the benefits of IaC.

  • A. Correct.

    Correct. This is the core IaC workflow Terraform is designed for: declare the desired end state in configuration, keep that configuration in version control, review proposed changes, and use Terraform to reconcile real infrastructure with the configuration. This supports repeatability, collaboration, and reduced drift across environments.

  • B. Incorrect.

    Incorrect. Terraform is not primarily a reporting or documentation tool. While it can import or discover existing infrastructure in some workflows, its main purpose is to manage infrastructure as code by defining and applying desired state. Treating it only as documentation does not solve consistency or drift problems.

  • C. Incorrect.

    Incorrect. Shell scripts and provider CLIs can automate tasks, but they do not provide Terraform's declarative model, dependency graph, execution planning, and state tracking. This option reflects an imperative scripting approach rather than Terraform's IaC model.

  • D. Incorrect.

    Incorrect. Using Terraform only for initial provisioning but then making ongoing manual console changes undermines IaC practices and reintroduces configuration drift. A key benefit of Terraform is ongoing lifecycle management through code, not just one-time creation.

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