Terraform
Learning Path - Terraform Associate 004
Assessment details
This exam tests on Terraform 1.12.
Prerequisites
- Basic terminal skills
- Basic understanding of on-premises and cloud architecture
To learn more about the exam, visit the HashiCorp Product Certifications page.
Study for the exam
This guide lists resources you should study if you are preparing for the Terraform Associate certification exam. The resources are ordered by level of complexity. We recommend studying them in the order that they appear. For resources related to a particular test objective, refer to the exam content list instead.
Visit the HashiCorp Cloud Engineer Certification page for information on the exam and to sign up.
Learn about Infrastructure as Code (IaC)
Terraform is a tool that lets you define infrastructure in human and machine-readable code. Review the following resources to learn about the advantages of Infrastructure as Code (IaC), and the advantages of Terraform specifically, which covers Objective #1 in the exam.
- Infrastructure as Code introduction video
- How Terraform helps you manage Infrastructure as Code
- Introduction to Infrastructure as Code with Terraform
- Infrastructure as Code in a private or public cloud blog post
- Terraform use cases documentation
Review Terraform fundamentals
Complete all tutorials in the Get Started with Terraform collection for the cloud provider of your choice: Amazon Web Services, Microsoft Azure, Google Cloud Platform, or Docker. In these tutorials, you will create, modify, and destroy your first infrastructure using Terraform. You will also learn about Terraform providers and the concept of Terraform state. These resources cover Terraform fundamentals you will be tested on in Objective #2 of the exam.
Review the following resources to learn more about how Terraform uses a workspace's state and providers to manage infrastructure.
- How Terraform works with plugins documentation
- Purpose of Terraform state documentation
- Providers overview documentation
Review the following resources to learn how to manage Terraform and provider versions in workspaces.
- Manage Terraform versions tutorial
- Lock and upgrade provider versions tutorial
terraformblock reference documentation- Provider requirements documentation
- Dependency lock file documentation
Use the core Terraform workflow
The core Terraform workflow consists of writing configuration, initializing a workspace in a local working directory, planning infrastructure changes, and then applying them. The Terraform CLI also offers subcommands to validate and format your configuration as you develop it. Review the following resources to learn about the core Terraform workflow, which cover Objective #3 of the exam.
- The core Terraform workflow documentation
- Initialize Terraform configuration tutorial
terraform initcommand documentationterraform fmtcommand documentationterraform validatecommand documentation- Create a Terraform plan tutorial
terraform plancommand documentation- Apply Terraform configuration tutorial
terraform applycommand documentationterraform destroycommand documentation
Terraform creates plans for infrastructure changes by creating a depedency graph between the resources defined in a workspace's configuration. Review the Terraform dependency graph documentation to learn how the dependency graph works, how to manage resource lifecycle, and how to troubleshoot Terraform.
Read and write configuration
Terraform configuration uses the HashiCorp Configuration Language (HCL). Review these resources to learn more about reading and writing Terraform configuration, which cover Objective #4 of the exam.
Review the following resources to learn about declaring resource and data source blocks.
- Define infrastructure with resources tutorial
- Resources documentation
resourceblock reference documentation- Query data sources tutorial
- Data sources documentation
datablock reference documentation
Review the following resources to learn how to reference and create dependencies between Terraform resources, data sources, and other constructs.
- Create resource dependencies tutorial
- Reference named values documentation
- Resource addressing documentation
depends_onmeta-argument reference documentation- Target resources tutorial
Review the following resources to learn how to use input variables and output values in Terraform configuration.
- Customize Terraform configuration with variables tutorial
- Define module input arguments with variables documentation
- Output data from Terraform tutorial
- Define outputs to expose module data documentation
Review the following resources to learn how to use functions, complex data types, and dynamic expressions in Terraform configuration.
- Perform dynamic operations with functions tutorial
- Built-in functions documentation
- Create dynamic expressions tutorial
- Type constraints documentation
Review the following resources to learn how to use Terraform to manage resource lifecycle.
- Manage resource lifecycle tutorial
- Resource lifecycle documentation
Review the following resources to learn how to use custom conditions and checks to validate configuration.
- Validate your configuration documentation
- Validate modules with custom conditions tutorial
- Use checks to validate infrastructure tutorial
Terraform configuration may require access to sensitive data to provision infrastructure. Review the following resources to learn how to protect sensitive data with Terraform and Vault.
- Protect sensitive input variables tutorial
- Manage sensitive data documentation
- Inject secrets into Terraform using the vault provider tutorial
Use and create modules
Modules help you organize and re-use Terraform configuration. Review the following resources to learn how to use modules from the Terraform registry and how to create your own modules, which cover Objective #5 in the exam.
- Modules overview documentation
- Use registry modules in configuration tutorial
- Use modules in your configuration documentation
- Build and use a local module tutorial
- Standard module structure documentation
- Providers within modules documentation
- Set configuration parameters documentation
- Best practices for composing modules
Learn about Terraform state management
When you apply a configuration, Terraform creates a state file that maps real world resources to your configuration, keeps track of metadata, and improves performance for large infrastructures. Review the following resources to learn how to manage Terraform state, which cover Objective #6 in the exam.
- Terraform state documentation
- Manage resources in Terraform state tutorial
- Use refresh-only mode to sync Terraform state
- Manage resource drift tutorial
- Use configuration to move resources tutorial
- Refactor Terraform state documentation
movedblock reference documentation- Remove a resource from state documentation
Terraform supports storing your state file locally, in a remote backend, or in HCP Terraform. Review the following resources to learn how to manage local and remote state backends. Using HCP Terraform is covered in objective #8.
backendblock configuration documentation- State storage and locking documentation
Maintain infrastructure with Terraform
After provisioning resources with Terraform, use Terraform to maintain the infrastructure managed in a workspace. Review the following resources to learn how to maintain an infrastructure project with a Terraform workspace, which cover Objective #7 in the exam.
- Import Terraform configuration tutorial
- Import existing resources documenation
- Troubleshoot Terraform tutorial
terraform state listcommand documentationterraform showcommand documentation- Enable Terraform logs documentation
Use HCP Terraform
HCP Terraform is HashiCorp's hosted service for Terraform. It securely stores state, credentials, and environment variables, and can connect to version control systems. The following resources cover Objective #8 in the exam.
Review the following resources to learn how to use HCP Terraform to manage infrastructure in Terraform workspaces.
- What is HCP Terraform documentation
- Get started - HCP Terraform tutorial collection
- Remote operations documentation
HCP Terraform supports multiple execution workflows, including the CLI-driven and VCS-driven workflows. Review the following resources to learn how to migrate a local workspace to HCP Terraform and implement the CLI-driven workflow.
- Use HCP Terraform with the Terraform CLI documentation
terraform logincommand documentation- Migrate state to HCP Terraform tutorial
- Migrate state documentation
- Connect to HCP Terraform documentation
- Upgrade Terraform version in HCP Terraform tutorial
Review the following resource to learn how to connect with run triggers and remote state data sources.
- HCP Terraform workspaces documentation
- Connect workspaces with run triggers tutorial
- Run triggers documentation
terraform_remote_statedata source documentation
Review the following resources to learn how to organize workspaces into projects.
- Projects overview documentation
- Organize workspaces with projects tutorial
Review the following resources to learn how to manage multiple variable sets with HCP Terraform.
- Multiple variable sets tutorial
- Variable sets documentation
HCP Terraform includes features for collaboration and governance, including team permissions management, and health and policy assessments. Review the following resources to learn how to manage teams and permissions.
- Teams overview documentation
- Permissions overview documentation
Review the following resources to learn how to configure dynamic provider credentials in HCP Terraform.
- Authenticate providers with dynamic credentials tutorial
- Dynamic provider credentials documentation
Review the following resources to learn how to configure and use health assessments, drift detection, and policies in your HCP Terraform workspaces.
- Use health assessments tutorial
- Workspace health documentation
- Detect drift and enforce policies tutorial
- Policy overview documentation
Review the following resources to learn how to use HCP Terraform's explorer and change requests features.
- Explorer for workspace visibility documentation
- Change requests documentation
Continue studying
For specific study materials that cover a particular exam objective, refer to the content list. Check out the sample questions to review the exam question format.