TF-Associate-004 - Infrastructure as Code (IaC) with Terraform - 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.

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.