HashiCorp Terraform Associate (004) Question 10
Single answer1a Explain what IaC isA company has been creating cloud infrastructure manually through the provider's web console. After several outages, the platform team discovers that development, staging, and production are configured differently, and no one can reliably reproduce the environments. The team proposes using Terraform to manage infrastructure going forward. Which outcome best demonstrates the core value of Infrastructure as Code (IaC) in this situation?
- A
Engineers can define infrastructure in version-controlled configuration files so environments can be created and updated consistently and repeatedly.
- B
Terraform will automatically prevent all configuration drift without any review, planning, or re-application of changes.
- C
Using Terraform means administrators no longer need to understand the underlying cloud resources because Terraform manages them entirely.
- D
Infrastructure definitions stored in Terraform state replace the need to keep configuration files in source control.
Show answer and explanation
Correct answer: A
Explanation
Infrastructure as Code means defining and managing infrastructure through declarative or programmatic configuration files instead of manual point-and-click processes. In Terraform, this is typically done with configuration files that can be versioned, reviewed, reused, and applied consistently. In the scenario, the main IaC benefit is reproducibility and consistency across environments, which reduces errors caused by manual configuration differences. HashiCorp Terraform documentation emphasizes that Terraform lets you define infrastructure in human-readable configuration files, version them, reuse them, and share them. Terraform state supports lifecycle management, but it does not replace configuration files or source control. Likewise, Terraform can help identify drift, but IaC is not magic automation that removes the need for review, operational knowledge, or disciplined workflows.
- A. Correct.
Correct. This is the essence of IaC: infrastructure is described in machine-readable files and managed through a repeatable workflow. Storing Terraform configuration in version control allows teams to review, track, and reproduce infrastructure changes across environments. This directly addresses the scenario's problems of inconsistent environments and unreproducible manual changes.
- B. Incorrect.
Incorrect. Terraform helps detect differences between the desired configuration and actual infrastructure, but it does not automatically prevent all drift on its own. Teams still need to run workflows such as plan and apply, and out-of-band changes can still occur if people modify resources manually.
- C. Incorrect.
Incorrect. IaC does not remove the need to understand the infrastructure being managed. Teams still need to know what resources they are provisioning, their dependencies, limits, and operational implications. Terraform is a tool for defining and managing infrastructure, not a substitute for infrastructure knowledge.
- D. Incorrect.
Incorrect. Terraform state is not a replacement for source-controlled configuration. The state file records mappings between real resources and the configuration, while the configuration files are the authoritative human-maintained definition of desired infrastructure. Best practice is to store configuration in version control and manage state securely, often remotely.