HashiCorp Terraform Associate (004) · Section 1 · 6% of the exam
Describe the advantages of IaC patterns
One of the objectives of the HashiCorp Certified: Terraform Associate (004) exam, in the section “Infrastructure as Code (IaC) with Terraform”. Here is what it covers, the points to remember and a question to try.
What it covers
Infrastructure as Code (IaC) means defining and managing infrastructure through machine-readable files instead of manual clicks and one-off commands. This lesson explains declarative versus imperative styles, where Terraform fits, and the advantages the exam expects you to name: consistency, speed, version control, collaboration, reuse and drift detection.
Points to remember
- IaC = infrastructure defined in machine-readable files, versioned, reviewed and applied by automation
- Terraform is declarative: you state the desired end state and it works out the steps
- Terraform configuration is written in HCL in .tf files
- Idempotent: applying an unchanged configuration again changes nothing
- Terraform is primarily provisioning; Ansible, Chef and Puppet are primarily configuration management
Try a question
A platform team wants reviewers to see exactly what an infrastructure change will do before it is merged, without making the change. Which practice and command should they use?
- ARun terraform plan in the pull request pipeline and let reviewers read the proposed changes
- BRun terraform fmt on the pull request so the formatting diff shows what will change in the cloud
- CRun terraform apply against production and revert the commit if the result is wrong
- DRun terraform validate, which lists the resources that would be created or destroyed
Show the answer
A. terraform plan produces an execution plan that shows what Terraform would create, update or destroy, and it does not change infrastructure. Putting it in the review pipeline lets reviewers approve with full knowledge. This is a key IaC advantage.
Written for practice in the style of the exam: never a question from the real exam.
In the course
The lesson What Infrastructure as Code is and why it pays off teaches this objective (about 35 minutes), and 11 practice questions test it. The course has lessons, exam-style questions, timed practice exams and an AI tutor for every objective, and a pass prediction that tells you when you're ready to book.