Terraform Associate Course
A structured HashiCorp Terraform Associate course covering core concepts, state and backends, resources and modules, and Terraform Cloud and CLI with linked practice questions.
Course progress
0 / 5
Back to courses
What you will learn
- Understand the Terraform Associate exam structure.
- Write and understand HCL, resources, variables, and outputs.
- Manage state, backends, locking, and workspaces.
- Use count, for_each, provisioners, and reusable modules.
- Work with Terraform CLI, plans, applies, and Terraform Cloud.
Before you start
- No prior certification is required.
- Basic cloud computing knowledge is helpful.
- Installing Terraform and creating a free account helps practice.
Lesson 1 Understanding the Terraform Associate Exam
The HashiCorp Terraform Associate certification tests foundational knowledge of Terraform and infrastructure as code. The exam covers core concepts, state management, resources and provisioners, modules, and Terraform Cloud and CLI workflows. Questions are multiple choice and require you to understand how Terraform plans and applies changes. You should know HCL syntax, variables, outputs, providers, resources, data sources, and the main CLI commands such as init, validate, plan, and apply. You should also understand state, backends, locking, sensitive data, and remote state. Modules, workspaces, and Terraform Cloud runs are important topics too. A good study path starts with configuration basics, then moves to state and backends, then resources and modules, and finally CLI and Terraform Cloud workflows. This course organizes the exam topics into five lessons and links to a practice bank so you can test your understanding.
Example
Example: Terraform plan shows what will change, and terraform apply executes the change.Lesson 2 Core Concepts and Configuration
Terraform is an infrastructure as code tool that manages cloud resources declaratively. HCL is the configuration language used to define resources. A provider is a plugin that connects Terraform to a cloud or API. Resources are the infrastructure objects Terraform manages, and data sources read existing information. Variables let users pass input values, and outputs expose useful values after apply. The main commands are init, which prepares the working directory, validate, which checks syntax, plan, which shows changes, apply, which executes changes, and destroy, which removes resources. fmt formats files, and refresh updates state from real infrastructure. Terraform builds a dependency graph from references to determine the correct order for creating and updating resources. Understanding these basics makes the rest of the exam easier.
Example
Example: resource "aws_instance" "web" declares a virtual machine Terraform should create.Lesson 3 State and Backends
Terraform state maps configuration to real-world resources. The state file stores resource metadata, so Terraform can plan changes accurately. State can be stored locally or remotely in a backend. Remote backends such as Terraform Cloud, S3, or Azure Storage support team collaboration. State locking prevents concurrent runs from modifying state at the same time. Sensitive values may appear in plaintext in state, so you should use secure backends and access controls. The state command family includes list, show, mv, rm, pull, and push. terraform refresh updates state with real infrastructure values, and terraform import attaches existing resources to configuration. Workspaces provide separate states for the same configuration, which is useful for environments such as dev and production.
Example
Example: Use a remote backend so a team shares one state file with locking.Lesson 4 Resources and Modules
Resources are the core of Terraform configuration. count creates multiple instances from one block, and for_each iterates over maps or sets. depends_on declares explicit dependencies, and lifecycle blocks control behavior such as create_before_destroy and prevent_destroy. Provisioners run actions after resources are created; local-exec runs on the Terraform host, and remote-exec runs on the remote resource. Modules are reusable containers of configuration. The root module is the current working directory, and child modules can be called from local paths, the registry, or Git. Module inputs are variables and outputs are returned values. The Terraform Registry provides public modules and providers, and versioning lets you pin specific module releases. Good module design reduces duplication and makes infrastructure easier to maintain.
Example
Example: Call a network module from the registry and pass region and CIDR variables.Lesson 5 CLI and Terraform Cloud
Terraform CLI is the primary way to interact with configuration. Common commands include init, validate, fmt, plan, apply, destroy, output, state, and import. terraform plan -out saves an execution plan that can be applied later. Terraform Cloud is a managed service that stores state remotely, runs plans and applies, manages variables, and supports team workflows. A run represents the plan and apply pipeline for a workspace. Variables can be stored in workspaces and marked sensitive. Run triggers start runs when linked sources change. Workspaces let teams manage environments such as dev, staging, and production separately. You should understand when to use local workflows versus Terraform Cloud and how to inspect and troubleshoot runs and state.