Cloud engineers are expected to build infrastructure that is consistent, repeatable, and easy to maintain. Creating every server, network, or database manually is slow and can lead to configuration errors. Infrastructure as Code solves this problem by allowing teams to define and manage infrastructure through configuration files.
Terraform is one of the most widely used Infrastructure as Code tools. It allows engineers to manage infrastructure across cloud platforms, on-premises environments, and third-party services through a consistent workflow.
The HashiCorp Certified: Terraform Associate 004 certification validates foundational Terraform knowledge. It tests your understanding of providers, state, modules, configuration, Terraform commands, resource management, and HCP Terraform.
This Terraform Associate 004 exam guide explains the latest exam objectives, important Terraform concepts, changes from exam 003, hands-on preparation tasks, and a practical 30-day study plan.
What Is theTerraform Associate 004 exam guide Certification?
Terraform Associate 004 is a foundational HashiCorp certification for cloud engineers and other technical professionals who use Terraform to manage infrastructure.
The certification is suitable for candidates who understand:
- Infrastructure as Code
- Terraform configuration files
- Terraform providers
- Terraform state
- Terraform modules
- Core Terraform commands
- Remote state and backends
- Resource drift
- HCP Terraform
- Basic cloud and on-premises architecture
The current exam tests knowledge of Terraform 1.12. Although professional experience is recommended, HashiCorp states that candidates may also prepare by practicing the exam objectives in a personal demo environment.
After learning the official objectives, use updated Terraform Associate 004 practice questions to identify areas that require further study.
Terraform Associate 004 Exam Details
The current exam information is:
| Exam detail | Information |
|---|---|
| Certification | HashiCorp Certified: Terraform Associate |
| Exam version | 004 |
| Terraform version tested | Terraform 1.12 |
| Assessment type | Multiple choice |
| Exam format | Online proctored |
| Exam duration | 1 hour |
| Exam price | $70.50 USD plus applicable taxes and fees |
| Exam language | English |
| Credential validity | Two years |
| Free retake | Not included |
These details are based on the official HashiCorp Terraform certification page. HashiCorp may change the price, exam policies, or technical requirements, so verify the information before registration.
HashiCorp does not publicly guarantee an exact number of questions or a fixed passing percentage on the certification page. Be careful with websites that present unofficial numbers as confirmed facts.
Who Should Take the Terraform Associate 004 Exam?
The certification is primarily designed for cloud engineers with foundational Terraform knowledge.
It may also be useful for:
- DevOps engineers
- Cloud administrators
- System administrators
- Site reliability engineers
- Infrastructure engineers
- Platform engineers
- Cloud developers
- Technical consultants
- Students learning Infrastructure as Code
- IT professionals moving into cloud roles
Candidates should have basic terminal skills and understand general cloud and on-premises architecture.
You do not need expert-level knowledge of AWS, Microsoft Azure, or Google Cloud. HashiCorp confirms that provider-specific knowledge is not necessary for the exam, even though its tutorials may use particular cloud providers as examples.
Terraform Associate 004 Exam Objectives
The official exam contains eight major objective groups:
- Infrastructure as Code with Terraform
- Terraform fundamentals
- Core Terraform workflow
- Terraform configuration
- Terraform modules
- Terraform state management
- Maintaining infrastructure with Terraform
- HCP Terraform
HashiCorp does not publish percentage weightings for these objective groups. Candidates should study all eight areas rather than attempting to skip one based on unofficial weight estimates.
Complete Terraform Associate 004 Exam Syllabus
Objective 1: Infrastructure as Code with Terraform
Start by understanding Infrastructure as Code and why organizations use it.
Infrastructure as Code allows engineers to define infrastructure through machine-readable configuration instead of relying on repeated manual steps.
Important benefits include:
- Repeatable infrastructure deployment
- Version-controlled configurations
- Consistent environments
- Easier collaboration
- Reduced manual configuration
- Faster infrastructure changes
- Reviewable change history
- Improved automation
- Support for multi-cloud workflows
- Easier disaster recovery
Terraform uses a declarative approach. You describe the desired infrastructure, and Terraform determines which actions are required to reach that state.
Declarative vs Imperative Approaches
An imperative approach defines the exact steps needed to reach a result. A declarative approach describes the required final state.
For example, an imperative script might contain individual commands to create and configure a server. A Terraform configuration declares that the server must exist with specific properties. Terraform then creates, updates, or replaces resources as required.
Multi-Cloud and Hybrid Cloud
Terraform supports multiple providers through a common configuration language and workflow.
This makes it possible to manage:
- Public cloud resources
- Private cloud infrastructure
- On-premises systems
- Software-as-a-Service platforms
- DNS providers
- Monitoring platforms
- Multiple providers in one configuration
Terraform does not remove the differences between cloud providers. It provides a consistent workflow for managing their resources.
Objective 2: Terraform Fundamentals
This objective covers providers, provider versions, multiple-provider configurations, and Terraform state.
What Is a Terraform Provider?
A provider is a plugin that allows Terraform to communicate with an API.
Common provider examples include:
- AWS
- Microsoft Azure
- Google Cloud
- Kubernetes
- GitHub
- Cloudflare
- Datadog
- HCP Terraform
A Terraform provider defines the resources and data sources that can be used in a configuration.
Example:
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.0"
}
}
}
provider "aws" {
region = "us-east-1"
}
The required_providers block identifies the source and acceptable version. The provider block supplies configuration settings.
Provider Version Constraints
You should understand common version operators:
| Operator | Meaning |
|---|---|
= 5.0.0 | Use exactly version 5.0.0 |
>= 5.0.0 | Use version 5.0.0 or newer |
~> 5.0 | Allow compatible versions within the specified range |
!= 5.1.0 | Exclude version 5.1.0 |
The .terraform.lock.hcl dependency lock file records selected provider versions and checksums. It helps teams use consistent provider selections.
Multiple Provider Configurations
Provider aliases allow a configuration to use multiple instances of the same provider.
For example, an AWS configuration might deploy resources in two regions:
provider "aws" {
region = "us-east-1"
}
provider "aws" {
alias = "west"
region = "us-west-2"
}
A resource can then select the aliased provider:
resource "aws_s3_bucket" "west_bucket" {
provider = aws.west
bucket = "example-west-bucket"
}
What Is Terraform State?
Terraform state maps configuration objects to real infrastructure resources. By default, Terraform stores state in a local terraform.tfstate file.
State helps Terraform:
- Track managed resources
- Store resource attributes
- Determine dependencies
- Compare configuration with infrastructure
- Calculate required changes
- Improve operation performance
State may contain sensitive information. It should be protected, access-controlled, and stored securely.
Objective 3: Core Terraform Workflow
The core Terraform workflow consists of writing, planning, and applying infrastructure changes.
Important commands include:
| Command | Purpose |
|---|---|
terraform init | Initialize the working directory |
terraform fmt | Format Terraform configuration |
terraform validate | Validate configuration syntax and structure |
terraform plan | Preview proposed infrastructure changes |
terraform apply | Apply planned changes |
terraform destroy | Destroy Terraform-managed resources |
Terraform Init
terraform init prepares a Terraform working directory.
It can:
- Download required providers
- Download modules
- Initialize the backend
- Create or update the dependency lock file
- Prepare the directory for other Terraform commands
Run terraform init after cloning a Terraform configuration or changing provider, module, or backend settings.
Terraform Plan
terraform plan compares the configuration, current state, and real infrastructure to calculate proposed changes.
The plan may show that Terraform will:
- Add resources
- Change resources
- Replace resources
- Destroy resources
- Make no changes
A saved plan file can be created and later passed to terraform apply.
Terraform Apply
terraform apply performs the proposed infrastructure changes. Without a saved plan, Terraform normally creates a new plan and asks for confirmation before applying it.
Candidates should understand that a configuration can change between separate plan and apply commands. A saved plan helps ensure that the reviewed changes are the ones applied.
Terraform Destroy
terraform destroy proposes and applies the removal of all resources managed by the current configuration and state.
Use it carefully, especially in production environments.
Objective 4: Terraform Configuration
This is one of the broadest areas in the Terraform Associate 004 exam guide.
Candidates should understand resources, data sources, variables, outputs, expressions, dependencies, validation, and sensitive values.
Resource Blocks vs Data Blocks
A resource block manages an infrastructure object:
resource "aws_instance" "web" {
ami = "ami-example"
instance_type = "t3.micro"
}
A data block reads information without creating the referenced object:
data "aws_ami" "latest" {
most_recent = true
owners = ["amazon"]
}
A resource creates or manages something. A data source retrieves information about something that already exists or is provided elsewhere.
Variables and Outputs
Input variables make configurations reusable.
variable "instance_type" {
type = string
default = "t3.micro"
description = "EC2 instance type"
}
Outputs expose useful information:
output "instance_id" {
value = aws_instance.web.id
}
Understand:
- Variable types
- Default values
- Descriptions
- Validation
- Sensitive values
- Output values
- Variable precedence
Complex Types
Terraform supports collection and structural types, including:
- List
- Set
- Map
- Object
- Tuple
You should know the difference between these types and how they are used in variables, local values, and resource arguments.
Expressions and Functions
Terraform expressions reference and transform values.
Frequently used concepts include:
- Conditional expressions
forexpressions- Splat expressions
- Dynamic blocks
- Built-in functions
countfor_each- Local values
You do not need to memorize every built-in function. Focus on understanding how functions and expressions create reusable, dynamic configurations.
Resource Dependencies
Terraform normally detects dependencies through references.
For example:
subnet_id = aws_subnet.main.id
This reference tells Terraform that the subnet must exist before the dependent resource is created.
Use depends_on for a hidden dependency that Terraform cannot automatically detect.
Lifecycle Rules
The 004 exam includes resource dependency and lifecycle concepts such as create_before_destroy.
Example:
lifecycle {
create_before_destroy = true
}
This rule instructs Terraform to create the replacement resource before destroying the existing one when replacement is required.
Custom Conditions and Checks
Terraform can validate assumptions through:
- Variable validation
- Preconditions
- Postconditions
- Check blocks
A failed variable validation prevents an unsuitable input from being accepted. Preconditions and postconditions validate resource-related assumptions. A check block can evaluate infrastructure behavior without necessarily blocking the operation.
Managing Sensitive Data
Avoid placing secrets directly in Terraform configuration files.
Good practices include:
- Using a secrets manager such as HashiCorp Vault
- Marking variables and outputs as sensitive
- Restricting state access
- Encrypting remote state
- Using short-lived credentials
- Avoiding secrets in source control
- Using environment variables appropriately
- Applying least-privilege access
The 004 exam also includes newer Terraform 1.12 concepts related to ephemeral values and write-only arguments, which can help reduce the persistence of sensitive information.
Objective 5: Terraform Modules
A module is a collection of Terraform configuration files used together.
Every Terraform configuration has a root module. A root module can call child modules.
Modules help teams:
- Reuse infrastructure patterns
- Reduce duplicated configuration
- Apply standards
- Organize large configurations
- Share tested components
- Manage consistent infrastructure
A module block may look like this:
module "network" {
source = "./modules/network"
vpc_cidr = "10.0.0.0/16"
}
Modules may come from:
- Local directories
- Terraform Registry
- Git repositories
- Version-control systems
- Private registries
- Supported remote sources
Understand module inputs, outputs, source addresses, version constraints, and variable scope.
Objective 6: Terraform State Management
State management is essential for safe and collaborative Terraform usage.
Candidates should understand:
- Local state
- Remote state
- Backends
- State locking
- Resource drift
- Refresh-only operations
- Moved blocks
- Removed blocks
- State security
Local and Remote Backends
A backend determines where Terraform stores state and, depending on the backend, how operations are performed.
Local state is simple but unsuitable for many team environments. Remote state can provide:
- Centralized storage
- Controlled access
- Encryption
- Collaboration
- State locking
- Backup and versioning
Example backend block:
terraform {
backend "s3" {
bucket = "example-terraform-state"
key = "production/terraform.tfstate"
region = "us-east-1"
}
}
Do not hardcode sensitive backend credentials in configuration.
State Locking
State locking prevents multiple supported operations from modifying the same state simultaneously.
Without locking, concurrent changes could create conflicts or corrupt the state.
Resource Drift
Drift occurs when real infrastructure changes outside Terraform and no longer matches the configuration or recorded state.
Terraform planning and refresh-related workflows can identify drift. Candidates should understand how to review and reconcile these changes safely.
Objective 7: Maintaining Infrastructure with Terraform
This objective covers resource import, state inspection, and Terraform logging.
Importing Existing Infrastructure
Terraform can bring an existing resource under its management.
Importing associates a real resource with a Terraform resource address. You must also create or generate configuration that describes the resource.
Candidates should understand both:
- The
terraform importcommand - Configuration-driven import blocks
Importing a resource does not mean Terraform automatically understands your desired long-term configuration.
Inspecting State with the CLI
Useful state commands include:
terraform state listterraform state showterraform state mvterraform state rmterraform show
State-manipulation commands can affect Terraform’s resource mappings. Back up state and understand the consequences before using them.
Terraform Logging
Terraform supports detailed logging through environment variables such as TF_LOG.
Logging can help troubleshoot:
- Provider errors
- Authentication problems
- API communication
- Unexpected plans
- Backend problems
- Plugin behavior
Verbose logs may contain sensitive information, so store and share them carefully.
Objective 8: HCP Terraform
HCP Terraform provides a managed environment for collaborative Terraform workflows.
It includes features for:
- Remote runs
- Remote state
- Workspaces
- Projects
- Teams and permissions
- Variable sets
- Private module registry
- Policy enforcement
- Run triggers
- Drift detection
- Dynamic provider credentials
- Governance
HCP Terraform Workspaces
An HCP Terraform workspace contains configuration and settings for a particular collection of infrastructure.
A workspace can include:
- Terraform configuration
- State
- Variables
- Run history
- Permissions
- Version-control integration
- Run settings
Do not assume that an HCP Terraform workspace is identical to a Terraform CLI workspace. They serve different organizational purposes.
Projects and Workspaces
Projects organize related HCP Terraform workspaces. They can help teams group infrastructure according to application, department, environment, or another organizational model.
HCP Terraform Integration
Candidates should understand how HCP Terraform connects with:
- Terraform CLI
- Version-control systems
- APIs
- Remote state
- Remote operations
- Provider credentials
- Run triggers
The 004 exam places more emphasis on HCP Terraform than the previous exam version.
Terraform Associate 004 vs 003
Terraform Associate 004 tests Terraform 1.12 and introduces additional topics.
Key updates include:
depends_oncreate_before_destroy- Custom validation conditions
- Ephemeral values
- Write-only arguments
- HCP Terraform projects and workspaces
- Greater HCP Terraform coverage
Candidates who prepared for exam 003 should not rely only on their old notes. Review all new objectives before taking the 004 exam.
Terraform Associate 004 30-Day Study Plan
Week 1: Terraform Fundamentals
Study:
- Infrastructure as Code
- Terraform installation
- Providers
- Provider versions
- Resources
- Data sources
- Variables
- Outputs
- Core Terraform workflow
Build and destroy a small local or cloud configuration.
Week 2: Configuration and Modules
Practice:
- Complex variables
- Local values
- Functions
- Conditional expressions
countfor_each- Dependencies
- Lifecycle rules
- Validation
- Child modules
- Module inputs and outputs
Refactor a basic configuration into reusable modules.
Week 3: State and HCP Terraform
Focus on:
- Local state
- Remote state
- Backends
- State locking
- Drift
- Importing resources
- State commands
- HCP Terraform workspaces
- Projects
- Remote runs
- Policy and governance features
Create a free HCP Terraform account if available and explore its workflow.
Week 4: Practice and Revision
During the final week:
- Review every official objective.
- Take a timed Terraform Associate 004 practice test.
- Record mistakes by objective.
- Revisit weak Terraform commands.
- Practice reading short HCL configurations.
- Review the differences between exam 003 and 004.
- Use HashiCorp’s official sample questions.
- Repeat the assessment without memorizing answers.
Explore the available Terraform Associate 004 practice material after completing the syllabus.
Common Preparation Mistakes
Avoid these mistakes:
- Memorizing commands without practicing them
- Ignoring HCP Terraform
- Confusing resources with data sources
- Treating state as an unimportant file
- Storing secrets in
.tffiles - Ignoring provider and module version constraints
- Studying only exam 003 material
- Skipping import and drift concepts
- Memorizing practice answers
- Not reading the official exam objectives
Frequently Asked Questions
Is Terraform Associate 004 difficult?
The exam is foundational, but it requires a clear understanding of Terraform workflows, configuration, modules, state, and HCP Terraform. Hands-on practice makes it significantly easier.
Which Terraform version does exam 004 test?
HashiCorp states that Terraform Associate 004 tests Terraform 1.12.
How long is the Terraform Associate 004 exam?
The exam duration is one hour.
How much does the exam cost?
The listed price is $70.50 USD, plus locally applicable taxes and fees. A free retake is not included.
How long is the certification valid?
The Terraform Associate 004 credential is valid for two years.
Is the exam available online?
Yes. HashiCorp delivers it as an online-proctored examination.
Do I need cloud experience?
HashiCorp recommends professional experience, but candidates can prepare through a personal demo environment. You should understand basic cloud and on-premises architecture.
Do I need to learn AWS for the exam?
No specific cloud-provider knowledge is required. You need to understand how Terraform providers and resources work, but the exam is not an AWS certification.
Are practice questions enough to pass?
No. Combine practice questions with official documentation, hands-on configuration, Terraform CLI practice, and HCP Terraform exploration.
The Terraform Associate 004 certification is a useful credential for professionals building foundational Infrastructure as Code skills. The exam covers much more than a few Terraform commands. You must understand providers, configuration, state, modules, resource maintenance, security practices, and collaborative HCP Terraform workflows.
Use this Terraform Associate 004 exam guide as a checklist. Practice every important command, create small configurations, deliberately introduce and fix errors, explore remote state, and review all eight official objectives.
After completing the official Terraform Associate 004 learning path, evaluate your readiness with updated Terraform Associate 004 practice questions under timed conditions.
