CertLumen

HashiCorp Terraform Associate (004) · Section 1 · 6% of the exam

Explain what IaC is

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

An administrator suspects a teammate changed a security rule in the cloud console. The rule was created by Terraform. Which action shows the difference between the real infrastructure and the configuration without changing anything?

  1. Aterraform init, which downloads the current rule settings into the working directory
  2. Bterraform fmt, which rewrites the configuration to match the live environment
  3. Cterraform validate, which compares the live rule with the configuration
  4. Dterraform plan, which refreshes real objects and shows what must change
Show the answer

D. terraform plan reads the current state of managed objects, compares them with the configuration and reports differences, including changes made outside Terraform. It does not modify infrastructure.

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.

More in this section

All 37 objectives · Next objective →