Search⌘ K
AI Features

Deploying Resources Using Terraform

Explore the core steps of deploying infrastructure using Terraform on AWS. Learn to initialize working directories, verify execution plans, apply configurations, and clean up resources. Gain practical knowledge of key Terraform commands for validating, formatting, and managing your infrastructure state.

Understanding the Terraform workflow

When we want to employ Terraform to deploy resources, we need to take a sequence of steps. After we’ve prepared our configuration files, the major workflow is as follows:

  1. Initialize a working directory
  2. Verify the execution plan
  3. Apply the execution plan
  4. Destroy existing infrastructure
Terraform workflow
Terraform workflow

Let’s consider a scenario where we’ve been tasked to set up a simple network infrastructure on AWS consisting of a VPC and a private subnet. The configuration file for this infrastructure has already been provided to us, as shown in the playground below. We’ll walk through the Terraform workflow to set up this infrastructure on AWS by following the steps given ...