Be able to explain idempotency, declarative configuration, and reproducibility, and to choose the right Terraform pattern for sharing code across environments. The most important thing: Terraform reconciles configuration with state, so the same configuration applied repeatedly yields the same infrastructure.
Start practicing
Understand IaC concepts — choose a session length
Free · No account required
Domain overview
This domain covers Infrastructure as Code fundamentals as they appear on the Terraform Associate exam: idempotency, declarative versus imperative provisioning, version-controlled configuration, and reusing code across environments with variables, modules, and workspaces. Questions are scenario-based, asking you to pick the concept or Terraform workflow that best solves a stated operational problem.
Exam objectives
Idempotency: repeated terraform apply runs converge to the same declared result without unintended drift
Declarative configuration versus imperative scripts, and how terraform plan detects differences from state
Reusing one configuration across dev, staging, and prod using input variables, modules, and workspaces
Version control and immutable, reproducible infrastructure replacing manual SSH provisioning and configuration edits
Confusing idempotency with simply rerunning commands: Terraform compares desired configuration against recorded state, not against a fresh imperative script execution.
Assuming workspaces alone isolate environments; state, credentials, and variable values still need deliberate separation to avoid cross-environment changes.
Treating terraform plan as an approval gate: it only previews changes, and applying without reviewing the plan can still destroy or replace resources.
Click any question to see the full explanation and answer options, or start a focused practice session above.
A team is adopting Terraform to manage infrastructure. One requirement is that all configuration changes must be reviewed and approved before being applied. The team wants to ensure that the Terraform state file reflects the actual deployed infrastructure at all times. Which practice should they implement to meet these requirements?
2An organization manages multiple environments (dev, staging, prod) using Terraform. They want to minimize code duplication while allowing environment-specific variable values. Which approach best achieves this goal?
3A junior administrator wants to practice Terraform by deploying a single web server in AWS. They write a configuration file and run terraform init and terraform apply. The deployment succeeds but they notice the web server is not accessible from the internet. What is the most likely reason?
4A company uses Terraform to manage infrastructure on AWS. They have a configuration that creates an S3 bucket and a DynamoDB table for state locking. The team notices that sometimes when two members run terraform apply simultaneously, they get a state locking error. However, they want to allow concurrent operations on different workspaces. What is the best approach?
5You are a DevOps engineer at a growing startup. The infrastructure currently consists of a single AWS EC2 instance running a web application, manually configured. The company plans to scale to multiple instances and environments (development, staging, production). They want to adopt Infrastructure as Code using Terraform. The team has limited experience with Terraform and wants to start small, then gradually adopt more advanced features. The current manual infrastructure must be imported into Terraform. The team also wants to ensure that code changes are reviewed via pull requests before being applied. Which of the following is the best course of action to meet these requirements?
6Which TWO statements about Infrastructure as Code (IaC) are correct?
7You are a platform engineer at a growing startup. The company currently manages infrastructure manually by SSH-ing into servers to install packages and update configurations. As the team grows, this approach has led to frequent configuration drift, inconsistent environments, and manual errors. Deploying a new environment takes several days and requires detailed runbooks. The CTO has asked you to propose a solution that improves consistency, reduces deployment time, and enables version control of infrastructure. You are evaluating Infrastructure as Code (IaC) tools like Terraform. Which course of action best addresses the CTO's requirements?
8Drag and drop the steps to initialize a Terraform working directory in the correct order.
9Drag and drop the steps to upgrade Terraform providers in a configuration in the correct order.
10Match each Terraform command to its primary function.
11Match each Terraform cloud/enterprise feature to its purpose.
12An organization wants to ensure that running the same Terraform configuration multiple times produces the same result without unintended changes. Which IaC concept is most critical for this goal?
13A team is evaluating Terraform and Ansible for infrastructure provisioning. They note that Terraform describes the desired end state, while Ansible defines steps to reach that state. This difference is best described as:
14A team of five engineers uses Terraform with a remote backend in AWS S3 with DynamoDB state locking. One engineer runs 'terraform apply' but it hangs at 'Acquiring state lock'. What is the most likely cause?
15A company has a Terraform module that creates an AWS VPC with subnets. They want to reuse this module across multiple AWS accounts. What is the best practice for referencing the module from different root configurations?
16During development, a Terraform user wants to check that their configuration is syntactically valid and internally consistent before running 'terraform plan'. Which command should they use?
17A Terraform configuration includes a variable for a database password marked as sensitive. When a user runs 'terraform apply', the password appears as (sensitive) in the plan output. However, they want to pass this password to a provisioner as an environment variable. What should they do?
18A Terraform user wants to visualize the execution order of resources before applying changes. Which command provides a dependency graph view?
19A team uses Terraform to manage multiple AWS EC2 instances with a 'count' meta-argument. They need to reference the ID of the third instance in another resource's configuration. Which expression should they use?
20An organization uses Terraform Cloud with VCS-driven runs. They have two workspaces: network and application. They want a new run in the application workspace to automatically trigger whenever the network workspace completes a successful plan. What should they configure?
21Which two are primary benefits of using Infrastructure as Code (IaC) with Terraform?
22Which three characteristics are associated with immutable infrastructure as practiced by Terraform?
23Which two commands are part of the standard Terraform workflow for provisioning infrastructure?
24Based on the exhibit, what can be inferred about the Terraform state and configuration?
25After applying the configuration above, the user changes the AMI to a new value and runs 'terraform apply'. Assuming the new AMI triggers a recreate, what happens during the apply?
26A team uses the backend configuration above. What is the primary benefit of storing state remotely in S3?
27A team wants to ensure that their infrastructure configuration repeatedly results in the same environment regardless of the initial state. Which IaC concept is most directly associated with this goal?
28A development team is using a declarative IaC tool. They make a change to the configuration file to add a new security group rule. When they apply the configuration, the tool automatically modifies the existing security group to add the rule. What is this behavior called?
29An organization is evaluating IaC tools and wants to minimize configuration drift. Which characteristic of a declarative IaC approach is most effective in preventing drift?
30Which of the following is a primary benefit of using Infrastructure as Code?
31A company is managing multiple cloud environments (dev, test, prod) using Terraform. They want to ensure consistent configurations across environments while allowing environment-specific values. Which IaC practice best supports this?
32A team uses Terraform to manage AWS resources. After a manual change to an S3 bucket policy through the AWS console, Terraform's next plan shows that it will revert the policy to the configuration. This is an example of which concept?
33Which statement best describes 'immutable infrastructure' in the context of IaC?
34A company uses Terraform to deploy virtual machines. They want to ensure that the same exact operating system and software versions are used every time. Which practice supports this?
35In Terraform, the `terraform plan` command compares the current state with the configuration. This is an example of which IaC principle?
36Which two are benefits of using Infrastructure as Code? (Choose two.)
37Which three practices help maintain consistency and reduce configuration drift in IaC? (Choose three.)
38Which two statements accurately describe the difference between declarative and imperative IaC approaches? (Choose two.)
39Refer to the exhibit. A team is using this S3 backend configuration. During a deployment, they receive an error that the state file is locked. What is the most likely cause?
40Refer to the exhibit. After applying this configuration, a team member manually changes the instance type to 't2.small' via the AWS console. The next `terraform plan` shows a change to revert to 't2.micro'. What does this demonstrate?
41A startup is adopting Terraform to manage their cloud infrastructure. They want to ensure that changes to infrastructure are reviewed and approved before being applied. Which practice aligns with Infrastructure as Code principles to achieve this?
42A team is defining their Infrastructure as Code strategy. Which two of the following are key benefits of using IaC compared to manual configuration?
43A company manages multiple AWS accounts using Terraform. They have a central repository where all Terraform configurations are stored. Recently, a developer accidentally ran terraform destroy on a production workspace and deleted critical resources. The team wants to implement safeguards to prevent such incidents while still allowing developers to test changes in non-production environments. They currently use Terraform Cloud for remote state management and runs. Which course of action should the team take to minimize risk?
44Which TWO statements correctly describe Infrastructure as Code principles?
45Refer to the exhibit. What will happen when you run terraform plan?
46A platform team is standardizing how infrastructure is provisioned across three cloud providers using Terraform. Leadership wants to reduce the risk of undocumented manual changes and ensure that every environment can be recreated identically on demand. Which two characteristics of infrastructure as code directly support these goals? (Choose two.)
47A cloud engineer is preparing to introduce Terraform to a team that currently provisions servers by opening support tickets and waiting for an operations group to build them manually. The engineer needs to explain the fundamental shift in how infrastructure is delivered. Which statement best describes the change that adopting Terraform represents?
48An organization is migrating from manually built environments to Terraform-managed infrastructure. During a design review, an architect argues that because Terraform configuration files are the source of truth, the team can safely delete the terraform.tfstate file after every successful apply to avoid storing sensitive data. What is the most accurate assessment of this proposal?
Deep-dive questions
The most-searched questions in this domain — detailed explanations, worked examples, full answer breakdowns.
Be able to explain idempotency, declarative configuration, and reproducibility, and to choose the right Terraform pattern for sharing code across environments. The most important thing: Terraform reconciles configuration with state, so the same configuration applied repeatedly yields the same infrastructure.
The Courseiva TF-004 question bank contains 48 questions in the Understand IaC concepts domain, covering the 13% of the exam attributed to this domain in the official HashiCorp blueprint. Click any question to see the full explanation and answer breakdown.
Start with a 10-question focused session to identify your baseline accuracy in this domain. Read every explanation — even for questions you answer correctly — to understand the reasoning. Once you score consistently above 80%, move to a 20–30 question session to confirm depth before moving to the next domain.
Yes — the session launcher on this page draws questions exclusively from the Understand IaC concepts domain. Choose 10, 20, 30, or 50 questions for a focused session, or click individual questions to review them one by one.
Save your results, see per-domain analytics, and get readiness scores — free, for every certification.
Sign Up FreeFree forever · Every certification included