Exam Preparation
**Question 1.** Which of the following best defines Infrastructure as Code (IaC)?
A) Manual configuration of servers via SSH
B) Managing infrastructure using machine‑readable files
C) Outsourcing infrastructure to a third‑party provider
D) Using graphical user interfaces to provision resources
Answer: B
Explanation: IaC involves defining and managing infrastructure through declarative,
version‑controlled code rather than manual processes.
**Question 2.** What primary benefit does IaC provide regarding deployment speed?
A) It eliminates the need for testing
B) It allows parallel manual configuration
C) It automates provisioning, reducing time‑to‑deploy
D) It requires longer approval cycles
Answer: C
Explanation: IaC automates resource creation, dramatically accelerating deployment compared
to manual steps.
**Question 3.** Which version‑control feature is most important for IaC collaboration?
A) Branch protection rules
B) Binary file storage
C) Tracking changes to configuration files
D) Automatic code formatting
Answer: C
Explanation: Version control tracks changes to IaC files, enabling collaboration, rollback, and
auditability.
,[HIA] HashiCorp Infrastructure Automation Certification
Exam Preparation
**Question 4.** Idempotency in IaC ensures that:
A) Resources are always created new on each run
B) Applying the same configuration multiple times yields the same result
C) State files are deleted after each apply
D) Variables are re‑initialized on each run
Answer: B
Explanation: Idempotent operations guarantee that repeated applications of the same code
leave the infrastructure unchanged after the first successful run.
**Question 5.** Terraform’s multi‑cloud capability is achieved by:
A) Using a single provider for all clouds
B) Writing separate scripts for each cloud manually
C) Configuring multiple provider blocks, each targeting a specific cloud
D) Relying on cloud‑specific CLI tools only
Answer: C
Explanation: Terraform can interact with multiple clouds by defining separate provider
configurations (e.g., aws, azurerm, google).
**Question 6.** In Terraform’s architecture, what is the role of the core?
A) Directly communicate with cloud APIs
B) Manage state, planning, and apply logic while delegating resource operations to providers
C) Store all provider binaries locally
D) Replace the need for providers
Answer: B
,[HIA] HashiCorp Infrastructure Automation Certification
Exam Preparation
Explanation: The Terraform core handles the workflow, state, and plan generation, while
providers implement the actual resource CRUD operations.
**Question 7.** How does Terraform communicate with a provider?
A) Through HTTP REST calls only
B) Via Remote Procedure Call (RPC) over gRPC
C) By executing shell scripts on the local machine
D) Using SSH tunnels to the cloud console
Answer: B
Explanation: Terraform uses a plugin protocol based on RPC (currently gRPC) to invoke provider
functions.
**Question 8.** The file `.terraform.lock.hcl` is used for:
A) Storing encrypted secrets
B) Pinning exact provider versions to ensure reproducible runs
C) Defining backend configuration
D) Listing all resources in the state
Answer: B
Explanation: The lock file records the exact provider versions resolved during `terraform init`,
preventing accidental upgrades.
**Question 9.** When configuring multiple providers for different AWS accounts, which
Terraform feature allows you to reference each separately?
A) Provider version constraints
B) Provider aliases
C) Provider namespaces
D) Provider modules
, [HIA] HashiCorp Infrastructure Automation Certification
Exam Preparation
Answer: B
Explanation: Provider aliases let you define distinct provider configurations (e.g., `aws.us_east`
and `aws.eu_west`) and reference them in resources.
**Question 10.** What does `terraform init` NOT do?
A) Download required provider plugins
B) Initialize the backend configuration
C) Apply the execution plan automatically
D) Set up the `.terraform` directory
Answer: C
Explanation: `terraform init` prepares the working directory but does not apply any changes;
`terraform apply` performs that step.
**Question 11.** Which command validates the syntax and internal consistency of Terraform
configuration files without contacting any remote APIs?
A) `terraform plan`
B) `terraform validate`
C) `terraform fmt`
D) `terraform refresh`
Answer: B
Explanation: `terraform validate` checks the configuration locally for errors and type
mismatches.
**Question 12.** During a `terraform plan`, what is the purpose of the “refresh” step?
A) It formats HCL files automatically
B) It updates the state file with the latest real‑world resource attributes before planning
C) It deletes all resources not defined in code