• HashiCorp Developer

  • HashiCorp Cloud Platform
  • Terraform
  • Packer
  • Consul
  • Vault
  • Boundary
  • Nomad
  • Waypoint
  • Vagrant
Terraform
  • Install
  • Tutorials
    • About the Docs
    • Configuration Language
    • Terraform CLI
    • Terraform Cloud
    • Terraform Enterprise
    • CDK for Terraform
    • Provider Use
    • Plugin Development
    • Registry Publishing
    • Integration Program
  • Registry(opens in new tab)
  • Try Cloud(opens in new tab)
  • Sign up
Terraform Home

Tutorials

Skip to main contentTutorials

Get Started

  • AWS
  • Azure
  • Docker
  • GCP
  • OCI
  • Terraform Cloud

Fundamentals

  • CLI
  • Configuration Language
  • Modules
  • Provision
  • State
  • Terraform Cloud

Use Cases

  • Applications
  • AWS Services
  • Azure Services
  • HashiCorp Products
  • IT/SaaS Providers
  • Kubernetes
  • Machine Images
  • Networking
  • Policy
  • Security

Certification Prep

  • Associate Prep (002)
  • Associate Prep (003)
  • Associate Tutorials (002)
  • Associate Tutorials (003)

Production

  • Automate Terraform
  • Enterprise Patterns
  • Terraform Enterprise

Integrations

  • CDK for Terraform
  • Community Providers
  • Custom Framework Providers
  • Custom SDK Providers
  • Secrets

  • Resources

  • Tutorial Library
  • Certifications
  • Community Forum
    (opens in new tab)
  • Support
    (opens in new tab)
  • GitHub
    (opens in new tab)
  • Terraform Registry
    (opens in new tab)
  1. Developer
  2. Terraform
  3. Tutorials

Overview

Try Terraform Cloud

Sign up for Terraform cloud for free and start managing infrastructure with your team.

Follow the tutorials

Get Started

Build, change, and destroy infrastructure with Terraform. Start here to learn the basics of Terraform with your favorite cloud provider.

  •  
    8 tutorials
    Build, change, and destroy AWS infrastructure using Terraform. Step-by-step, command-line tutorials will walk you through the Terraform basics for the first time.
    • Terraform
  •  
    8 tutorials
    Build, change, and destroy Azure infrastructure using Terraform. Step-by-step, command-line tutorials will walk you through the Terraform basics for the first time.
    • Terraform
  •  
    10 tutorials
    Collaborate on version-controlled configuration using Terraform Cloud. Follow this track to build, change, and destroy infrastructure using remote runs and state.
    • Terraform
  •  
    7 tutorials
    Build, change, and destroy Docker infrastructure using Terraform. Step-by-step, command-line tutorials will walk you through the Terraform basics for the first time.
    • Terraform
  •  
    7 tutorials
    Build, change, and destroy Google Cloud Platform (GCP) infrastructure using Terraform. Step-by-step, command-line tutorials will walk you through the Terraform basics for the first time.
    • Terraform
  •  
    7 tutorials
    Build, change, and destroy a virtual cloud network and subnet on Oracle Cloud Infrastructure (OCI) using Terraform. Step-by-step, command-line tutorials will walk you through the Terraform basics for the first time.
    • Terraform

New Tutorials

Try the newest tutorials for common Terraform tasks and use cases.

  •  
    12min
    Manage Hosted Kafka with the Confluent Terraform Provider
    Use the Confluent provider to create Kafka clusters, topics, and service accounts using Terraform.
    • Terraform
  •  
    18min
    Detect Infrastructure Drift and Enforce OPA Policies
    Use Terraform Cloud to enforce OPA policies and detect infrastructure configuration drift.
    • Terraform
  •  
    9min
    Create and Use No-Code Modules
    Use Terraform Cloud no-code modules to let users provision resources without writing Terraform configuration.
    • Terraform
  •  
    16min
    Customize Modules with Object Attributes
    Refactor a local module to organize related attributes with objects and make some attributes optional for module users.
    • Terraform
  •  
    14min
    Use Configuration to Move Resources
    Use the configuration-driven workflow to change Terraform resource IDs. Refactor configuration to move resources into modules using the `moved` block.
    • Terraform
  •  
    16min
    Validate Modules with Custom Conditions
    Add condition blocks to a module that deploys an application in an AWS VPC to validate that DNS and EBS support are enabled, and that the appropriate number of subnets are configured.
    • Terraform

Get Certified

Prepare for Associate Certification with our prep materials, or follow tutorials that cover most of the major topics covered in the exam.

  •  
    3 tutorials
    Prepare for Terraform Certification (002)
    Prepare for the HashiCorp Certified: Terraform Associate (002) exam. These guides list the test objectives for the exam and the complete list of docs and tutorials to study.
    • Terraform
  •  
    25 tutorials
    Associate Tutorial List (002)
    Study for the Terraform Associate (002) exam by following these tutorials. Login to Learn and bookmark them to track your progress. Study the complete list of study materials (including docs) in the Certification Prep guides.
    • Terraform
  •  
    3 tutorials
    Prepare for Terraform Certification (003)
    Prepare for the HashiCorp Certified: Terraform Associate (003) exam. These guides list the test objectives for the exam and the complete list of docs and tutorials to study.
    • Terraform
  •  
    38 tutorials
    Associate Tutorial List (003)
    Study for the Terraform Associate (003) exam by following these tutorials. Login to Learn and bookmark them to track your progress. Study the complete list of study materials (including docs) in the Certification Prep guides.
    • Terraform

Build Providers

Use the Terraform Plugin Framework to build providers that use common Go conventions.

  •  
    11 tutorials
    Call APIs with Custom Framework Providers
    Interact with APIs using Terraform providers. In these tutorials, use a provider as a bridge between Terraform and a target API. Then, extend Terraform by developing a custom Terraform provider based on the Terraform Plugin Framework.
    • Terraform

All Tutorials

  • Associate Tutorial List (002)
    • What is Infrastructure as Code with Terraform?
    • Install Terraform
    • Lock and Upgrade Provider Versions
    • Build Infrastructure
    • Destroy Infrastructure
    • Store Remote State
    • Log in to Terraform Cloud from the CLI
    • Migrate State to Terraform Cloud
    • Customize Terraform Configuration with Variables
    • Output Data from Terraform
    • Query Data Sources
    • Create Resource Dependencies
    • Perform Dynamic Operations with Functions
    • Manage Resources in Terraform State
    • Import Terraform Configuration
    • Manage Resource Drift
    • Use Refresh-Only Mode to Sync Terraform State
    • Troubleshoot Terraform
    • Modules Overview
    • Use Registry Modules in Configuration
    • Host a Static Website with S3 and Cloudflare
    • Provision Infrastructure with Cloud-Init
    • Provision Infrastructure with Packer
    • Install the Sentinel CLI
    • Inject Secrets into Terraform Using the Vault Provider
  • Associate Tutorial List (003)
    • What is Infrastructure as Code with Terraform?
    • Lock and Upgrade Provider Versions
    • Build Infrastructure
    • Change Infrastructure
    • Destroy Infrastructure
    • Store Remote State
    • Initialize Terraform Configuration
    • Create a Terraform Plan
    • Apply Terraform Configuration
    • Manage Terraform Versions
    • Customize Terraform Configuration with Variables
    • Protect Sensitive Input Variables
    • Output Data from Terraform
    • Query Data Sources
    • Create Resource Dependencies
    • Perform Dynamic Operations with Functions
    • Create Dynamic Expressions
    • Modules Overview
    • Use Registry Modules in Configuration
    • Build and Use a Local Module
    • Refactor Monolithic Terraform Configuration
    • Module Creation - Recommended Pattern
    • Manage Resources in Terraform State
    • Import Terraform Configuration
    • Target Resources
    • Manage Resource Drift
    • Use Refresh-Only Mode to Sync Terraform State
    • Troubleshoot Terraform
    • Inject Secrets into Terraform Using the Vault Provider
    • Log in to Terraform Cloud from the CLI
    • Migrate State to Terraform Cloud
    • What is Terraform Cloud - Intro and Sign Up
    • Create a Credentials Variable Set
    • Create a Workspace
    • Create Infrastructure
    • Change Infrastructure
    • Use VCS-Driven Workflow
    • Destroy Resources and Workspaces
  • Automate Terraform
    • Running Terraform in Automation
    • Deploy Infrastructure with Terraform and CircleCI
    • Configure GitHub.com Access through OAuth
    • Automate Terraform with GitHub Actions
    • Connect Workspaces with Run Triggers
    • Automate Terraform Cloud Workflows
    • Deploy Consul and Vault on Kubernetes with Run Triggers
    • Configure Snyk Run Task in Terraform Cloud
    • Create Preview Environments with Terraform, GitHub Actions, and Vercel
    • Set Up Terraform Cloud Run Task for HCP Packer
    • Validate Infrastructure and Enforce OPA Policies
  • Call APIs with Custom Framework Providers
    • Implement a Provider with the Terraform Plugin Framework
    • Configure Provider Client
    • Implement Data Source
    • Implement Logging
    • Implement Resource Create and Read
    • Implement Resource Update
    • Implement Resource Delete
    • Implement Resource Import
    • Implement Automated Testing
    • Implement Documentation Generation
    • Release and Publish to the Terraform Registry
  • Call APIs with Custom SDK Providers
    • Perform CRUD Operations with Providers
    • Setup and Implement Read
    • Add Authentication to a Provider
    • Implement Complex Read
    • Debug a Terraform Provider
    • Implement Create
    • Implement Update
    • Implement Delete
    • Implement Import
    • Release and Publish a Provider to the Terraform Registry
  • Collaborate using Terraform Cloud
    • Log in to Terraform Cloud from the CLI
    • Migrate State to Terraform Cloud
    • Connect Workspaces with Run Triggers
    • Manage Permissions in Terraform Cloud
    • Upgrade Terraform Version in Terraform Cloud
    • Configure GitHub.com Access through OAuth
    • Manage Private Environments with Terraform Cloud Agents
    • Deploy Infrastructure with the Terraform Cloud Operator for Kubernetes
    • Deploy Consul and Vault on Kubernetes with Run Triggers
    • Automate Terraform Cloud Workflows
    • Version Remote State with the Terraform Cloud API
    • Manage Variable Sets in Terraform Cloud
    • Configure Snyk Run Task in Terraform Cloud
    • Terraform Cloud Secrets Engine
    • Migrate State from S3 to Terraform Cloud
    • Create Preview Environments with Terraform, GitHub Actions, and Vercel
    • Set Up Terraform Cloud Run Task for HCP Packer
    • Identify Compromised Images with Terraform Cloud
    • Enforce Image Compliance with Terraform Cloud
    • Validate Infrastructure and Enforce OPA Policies
    • Detect Infrastructure Drift and Enforce OPA Policies
    • Create and Use No-Code Modules
  • Community Providers
    • Create a Spotify Playlist with Terraform
  • Customize Terraform Enterprise
    • Forward Terraform Enterprise Logs to Datadog
    • Enable Single Sign On (SSO) in Terraform Enterprise
    • Use hcdiag with Terraform
  • Define Terraform Configuration with CDKTF
    • Install CDK for Terraform and Run a Quick Start Demo
    • Build AWS Infrastructure with CDK for Terraform
    • Deploy Lambda Functions with TypeScript and CDK for Terraform
    • Deploy Applications with CDK for Terraform
  • Deploy and Monitor Applications
    • Use Application Load Balancers for Blue-Green and Canary Deployments
    • Host a Static Website with S3 and Cloudflare
    • Deploy, Manage, and Scale an Application on Heroku
    • Deploy an Application to a DigitalOcean Droplet
    • Deploy Federated Multi-Cloud Kubernetes Clusters
    • Deploy Applications with CDK for Terraform
    • Manage Hosted Kafka with the Confluent Terraform Provider
    • Automate Monitoring with the Terraform Datadog Provider
    • Create Preview Environments with Terraform, GitHub Actions, and Vercel
  • Enforce Policy with Sentinel
    • Install the Sentinel CLI
    • Generate Policy Mock Data
    • Write a Sentinel Policy for a Terraform Deployment
    • Test Sentinel Policies
    • Upload Your Sentinel Policy Set to Terraform Cloud
    • Control Costs with Policies
    • Detect Infrastructure Drift and Enforce OPA Policies
  • Get Started - AWS
    • What is Infrastructure as Code with Terraform?
    • Install Terraform
    • Build Infrastructure
    • Change Infrastructure
    • Destroy Infrastructure
    • Define Input Variables
    • Query Data with Outputs
    • Store Remote State
  • Get Started - Azure
    • What is Infrastructure as Code with Terraform?
    • Install Terraform
    • Build Infrastructure - Terraform Azure Example
    • Change Infrastructure
    • Destroy Infrastructure
    • Define Input Variables
    • Query Data with Output Variables
    • Store Remote State
  • Get Started - Docker
    • What is Infrastructure as Code with Terraform?
    • Install Terraform
    • Build Infrastructure - Terraform Docker Example
    • Change Infrastructure
    • Destroy Infrastructure
    • Define Input Variables
    • Query Data with Outputs
  • Get Started - Google Cloud
    • What is Infrastructure as Code with Terraform?
    • Install Terraform
    • Build Infrastructure - Terraform GCP Example
    • Change Infrastructure
    • Destroy Infrastructure
    • Define Input Variables
    • Query Data with Output Variables
  • Get Started - OCI
    • What is Infrastructure as Code with Terraform?
    • Install Terraform
    • Build Infrastructure - Terraform OCI Example
    • Change Infrastructure
    • Destroy Infrastructure
    • Define Input Variables
    • Query Data with Outputs
  • Get Started - Terraform Cloud
    • What is Terraform Cloud - Intro and Sign Up
    • Log in to Terraform Cloud from the CLI
    • Create a Credentials Variable Set
    • Create a Workspace
    • Create Infrastructure
    • Change Infrastructure
    • Use VCS-Driven Workflow
    • Destroy Resources and Workspaces
    • Enforce a Policy
    • Control Costs with Policies
  • HashiCorp Products - Better Together
    • Inject Secrets into Terraform Using the Vault Provider
    • Terraform Cloud Secrets Engine
    • Codify Management of Vault Using Terraform
    • Codify Management of Vault Enterprise Using Terraform
    • AppRole With Terraform & Chef
    • Deploy HCP Vault with Terraform
    • Deploy Consul and Vault on Kubernetes with Run Triggers
    • Configure self-hosted Boundary using Terraform
    • Target-Aware Workers
    • OIDC Authentication
    • Network Infrastructure Automation with Consul-Terraform-Sync Intro
    • Consul-Terraform-Sync Run Modes and Status Inspection
    • Use Terraform to Register External Services
    • Deploy HCP Consul with Terraform
    • Provision Infrastructure with Packer
    • Use Application Load Balancers for Blue-Green and Canary Deployments
  • Inject Secrets with Vault
    • Inject Secrets into Terraform Using the Vault Provider
    • Terraform Cloud Secrets Engine
  • Interact with Security tools
    • Codify Management of Vault Using Terraform
    • Codify Management of Vault Enterprise Using Terraform
    • AppRole With Terraform & Chef
    • Deploy Consul and Vault on Kubernetes with Run Triggers
    • Inject Secrets into Terraform Using the Vault Provider
    • Terraform Cloud Secrets Engine
    • Configure self-hosted Boundary using Terraform
    • Target-Aware Workers
    • OIDC Authentication
  • IT/SaaS Providers
    • Manage Azure Active Directory (Azure AD) Users and Groups
    • Manage Your Google Workspace Organization
    • Manage GitHub Users, Teams, and Repository Permissions
  • Manage AWS Services
    • Manage AWS Auto Scaling Groups
    • Manage AWS Accounts Using Control Tower Account Factory for Terraform
    • Manage New AWS Resources with the Cloud Control Provider
    • Upgrade RDS Major Version
    • Use AssumeRole to Provision AWS Resources Across Accounts
    • Configure Default Tags for AWS Resources
    • Create IAM Policies
    • Deploy Serverless Applications with AWS Lambda and API Gateway
    • Use Application Load Balancers for Blue-Green and Canary Deployments
    • Host a Static Website with S3 and Cloudflare
    • Manage AWS RDS Instances
    • Provision an EKS Cluster (AWS)
    • Create Preview Environments with Terraform, GitHub Actions, and Vercel
    • Manage AWS DynamoDB Scale
  • Manage Azure Services
    • Deploy the Microsoft Cloud Adoption Framework Enterprise-Scale Module
    • Provision an AKS Cluster (Azure)
    • Manage Azure Active Directory (Azure AD) Users and Groups
    • Deploy Federated Multi-Cloud Kubernetes Clusters
  • Manage Kubernetes with Terraform
    • Provision an EKS Cluster (AWS)
    • Provision an AKS Cluster (Azure)
    • Provision a GKE Cluster (Google Cloud)
    • Manage Kubernetes Resources via Terraform
    • Deploy Consul and Vault on Kubernetes with Run Triggers
    • Automate Terraform Cloud Workflows
    • Deploy Infrastructure with the Terraform Cloud Operator for Kubernetes
    • Deploy Applications with the Helm Provider
    • Manage Kubernetes Custom Resources
    • Deploy Federated Multi-Cloud Kubernetes Clusters
  • Manage Terraform State
    • Import Terraform Configuration
    • Migrate State to Terraform Cloud
    • Manage Resources in Terraform State
    • Target Resources
    • Troubleshoot Terraform
    • Manage Resource Drift
    • Manage Resource Lifecycle
    • Version Remote State with the Terraform Cloud API
    • Use Refresh-Only Mode to Sync Terraform State
    • Develop Configuration with the Console
    • Use Configuration to Move Resources
  • Manage Virtual Machine Images
    • Provision Infrastructure with Packer
    • Manage VMs and Snapshots on vSphere
  • Network Applications with Terraform
    • Network Infrastructure Automation with Consul-Terraform-Sync Intro
    • Consul-Terraform-Sync Run Modes and Status Inspection
    • Use Terraform to Register External Services
    • Use Application Load Balancers for Blue-Green and Canary Deployments
    • Deploy Federated Multi-Cloud Kubernetes Clusters
  • Prepare for Terraform Certification (002)
    • Study Guide - Terraform Associate Certification (002)
    • Sample Questions - Terraform Associate Certification
    • Exam Review - Terraform Associate Certification (002)
  • Prepare for Terraform Certification (003)
    • Study Guide - Terraform Associate Certification (003)
    • Sample Questions - Terraform Associate Certification
    • Exam Review - Terraform Associate Certification (003)
  • Provision Infrastructure
    • Provision Infrastructure with Cloud-Init
    • Provision Infrastructure with Packer
    • Set Up Terraform Cloud Run Task for HCP Packer
    • Identify Compromised Images with Terraform Cloud
    • Enforce Image Compliance with Terraform Cloud
  • Recommended Enterprise Patterns
    • Module Creation - Recommended Pattern
    • Terraform Enterprise Backup - Recommended Pattern
    • Terraform Enterprise Recovery and Restore - Recommended Pattern
    • Forward Terraform Enterprise Logs to Datadog
    • Use hcdiag with Terraform
  • Reuse Configuration with Modules
    • Modules Overview
    • Use Registry Modules in Configuration
    • Build and Use a Local Module
    • Customize Modules with Object Attributes
    • Share Modules in the Private Registry
    • Add Public Providers and Modules to your Private Registry
    • Refactor Monolithic Terraform Configuration
    • Module Creation - Recommended Pattern
    • Use Configuration to Move Resources
    • Create and Use No-Code Modules
  • Use the Command Line Interface
    • Initialize Terraform Configuration
    • Create a Terraform Plan
    • Apply Terraform Configuration
    • Customize Terraform Configuration with Variables
    • Output Data from Terraform
    • Manage Terraform Versions
    • Lock and Upgrade Provider Versions
    • Target Resources
    • Manage Resources in Terraform State
    • Import Terraform Configuration
    • Use Refresh-Only Mode to Sync Terraform State
    • Log in to Terraform Cloud from the CLI
    • Migrate State to Terraform Cloud
    • Troubleshoot Terraform
    • Develop Configuration with the Console
    • Verify Terraform Binary Archives
  • Write Terraform Configuration
    • Define Infrastructure with Terraform Resources
    • Perform CRUD Operations with Providers
    • Customize Terraform Configuration with Variables
    • Protect Sensitive Input Variables
    • Simplify Terraform Configuration with Locals
    • Output Data from Terraform
    • Query Data Sources
    • Create Resource Dependencies
    • Manage Similar Resources with Count
    • Manage Similar Resources with For Each
    • Perform Dynamic Operations with Functions
    • Create Dynamic Expressions
    • Lock and Upgrade Provider Versions
    • Troubleshoot Terraform
    • Manage Terraform Versions
    • Use Configuration to Move Resources
    • Validate Modules with Custom Conditions
    • Customize Modules with Object Attributes

On this page

  1. Get Started
  2. New Tutorials
  3. Get Certified
  4. Build Providers
  5. All Tutorials
Give Feedback(opens in new tab)
  • Certifications
  • System Status
  • Terms of Use
  • Security
  • Privacy
  • Trademark Policy
  • Trade Controls
  • Give Feedback(opens in new tab)