Course contentsShow
← Cloud and Infrastructure
Lesson 768 of 2,98914. Terraform FundamentalsFree lesson

The Terraform Workflow Overview

Understanding the core Terraform workflow: write, plan, apply, and how it enables safe infrastructure changes.

The Terraform Workflow Overview

What you'll learn: How Terraform's core workflow—write, plan, apply—enables safe, predictable infrastructure changes.

The Heart of Terraform's Safety

Terraform operates through a simple three-step workflow that puts you in complete control before any infrastructure changes happen. Think of it like editing a document: you write your changes, preview them, then save when you're confident everything looks right.

The Three-Step Workflow

1. Write

You create or modify .tf configuration files using HCL syntax. This is where you define resources, variables, data sources, and outputs—everything you've learned so far. Your configuration describes your desired state.

2. Plan

Run terraform plan to see exactly what Terraform will do. This command compares your configuration against the current state and shows you what will be created, modified, or destroyed. No actual changes happen yet—it's a safe preview.

3. Apply

When you're satisfied with the plan, run terraform apply. Terraform executes the planned changes, interacting with provider APIs to make your infrastructure match your configuration. You'll see real-time progress as resources are provisioned.

Why This Workflow Matters

This deliberate separation between planning and applying prevents costly mistakes. You can review changes, share plans with teammates, and catch errors before they affect production. It's the opposite of making manual changes in a cloud console where one wrong click is permanent.

The workflow also integrates beautifully with version control: commit your configuration changes, review the plan in CI/CD, then apply automatically or manually depending on your environment.

Key Takeaway: Terraform's write-plan-apply workflow gives you a safety net for infrastructure changes, letting you preview exactly what will happen before committing to any modifications.