TF-Associate-004 - Infrastructure as Code (IaC) with Terraform (8% of the exam) - Section 1b

Describe the advantages of IaC patterns.

Repeatability, reviewable change through version control, reduced configuration drift, self-documenting infrastructure, and the ability to reproduce or tear down an environment reliably. Candidates should map a stated organisational problem to the IaC advantage that addresses it, rather than reciting a list.

repeatabilityconfiguration driftcode review of infrastructurereproducible environments

Practice question for this objective

Free sampleInfrastructure as Code (IaC) with Terraformeasy

During a code review, a reviewer notices the whole team's cloud infrastructure is now expressed as Terraform configuration files committed to the shared Git repository. Which practical benefit does keeping these files under version control provide?

  • AIt removes the need for a Terraform state file, because Git history already records every resource that currently exists.
  • BIt guarantees that applied infrastructure can never drift from the configuration, since Git blocks any out-of-band change.
  • CIt encrypts the credentials stored inside the configuration automatically whenever a commit is pushed to the shared repository.
  • DIt lets the team review proposed infrastructure changes as diffs, roll back to a previous revision, and see who changed what and when. Correct
Storing Terraform configuration in version control brings code review, diffs, rollback, and an audit trail to infrastructure changes. Version-controlled infrastructure means the configuration is text tracked by Git, so proposed changes appear as reviewable diffs, previous revisions can be restored, and every change carries authorship and timing.

Why A is wrong: This is tempting because both track history, but Git versions the configuration, not live resource identifiers; Terraform still needs its state file to map configuration to real resources.

Why B is wrong: Version control cannot prevent someone editing resources directly in the console, so drift is still possible; Git records file history but does not police the live environment.

Why C is wrong: This invents a security feature; Git does not encrypt file contents on push, and secrets committed in plain text stay readable, which is why they should be kept out of the configuration.

Why D is correct: Because the configuration is text under version control, standard Git workflows apply: pull-request diffs, rollbacks to earlier revisions, and an author and timestamp for every change.

See more TF-Associate-004 practice questions, answers explained.

Exam traps in Infrastructure as Code (IaC) with Terraform

Answers that look right on this material and are not. Each one is a distractor from a different question in the TF-Associate-004 bank for this domain.

  • Faster raw provisioning speed, because Terraform always creates cloud resources more quickly than the console does.

    Why it is wrong: Speed can improve, but Terraform is not guaranteed to be faster than the console, and speed is not what fixes environments that differ from each other.

  • Manually recreate the resources in the console each time, keeping notes so the setup can be repeated later.

    Why it is wrong: Manual recreation is slow and drifts between runs, which is the very problem IaC solves, so it defeats the goal of a reproducible environment.

  • Writing application source code that runs directly on servers to handle user requests and business logic at runtime.

    Why it is wrong: This describes application development, which is tempting because both involve code, but IaC governs the infrastructure the application runs on rather than the application itself.

More in this domain

Back to all Infrastructure as Code (IaC) with Terraform objectives, or the TF-Associate-004 cert hub.

Examworthy is not affiliated with or endorsed by HashiCorp. Original, blueprint-aligned practice material only.