Holmes Stacks
Career · June 5, 2026

The Terraform mistake that breaks every deploy

This video teaches you how to use Terraform to create repeatable, consistent cloud infrastructure and avoid configuration errors.

What this guide covers

After finishing this guide, you’ll be able to define, manage, and deploy AWS cloud infrastructure reliably using Terraform code instead of manual console changes. This ensures consistent environments and reduces the risk of unexpected outages.

When to use it

  • You must deploy the same EC2 instance configuration repeatedly across dev, staging, and prod.
  • Troubleshooting inconsistent environment setups caused by manual console changes.
  • Automating infrastructure provisioning to speed up deployment cycles.
  • Ensuring infrastructure changes are version controlled and auditable.

The move, step by step

  1. Install Terraform and configure AWS CLI credentials
    Download Terraform from terraform.io and configure your AWS CLI with aws configure so Terraform can authenticate to AWS (source: Terraform AWS provider docs).

  2. Create a Terraform configuration file
    In a new folder, write a main.tf file describing your AWS resources. Use this example block for a reusable EC2 instance:

    resource "aws_instance" "example" {
      ami           = "ami-0c55b159cbfafe1f0"
      instance_type = "t2.micro"
      tags = {
        Name = "example-instance"
      }
    }
  3. Initialize the working directory
    Run terraform init to download required provider plugins and prepare the directory.

  4. Preview your planned changes
    Use terraform plan to see what infrastructure Terraform will create or modify without affecting live resources.

  5. Apply the infrastructure changes
    Use terraform apply and confirm to provision resources described in the config files. This creates or updates the AWS EC2 instance as defined.

  6. Keep your Terraform files in version control
    Commit all .tf files and lock files to git. This keeps a history of infrastructure changes and lets you roll back if needed.

  7. Avoid manual AWS Console changes
    Never modify resources directly in the AWS Console. Always update *.tf files and reapply Terraform to keep state consistent.

Example

Input: main.tf

resource "aws_instance" "example" {
  ami           = "ami-0c55b159cbfafe1f0"
  instance_type = "t2.micro"
  tags = {
    Name = "example-instance"
  }
}

Commands:

terraform init
terraform plan
terraform apply

Expected output snippet after apply:

aws_instance.example: Creating...
aws_instance.example: Creation complete after 30s [id=i-0123456789abcdef0]
Apply complete! Resources: 1 added, 0 changed, 0 destroyed.

Common mistakes

  • Mistake: Changing infrastructure manually in AWS Console → Fix: Always use Terraform code to manage resources.
  • Mistake: Not initializing Terraform directory before commands → Fix: Run terraform init first in each new project folder.
  • Mistake: Committing temporary or local state files to git → Fix: Only commit .tf files; add .terraform/ and terraform.tfstate to .gitignore.
  • Mistake: Using hard-coded AMI IDs without considering regions or updates → Fix: Use data sources or variables to manage AMI dynamically (see Terraform AWS docs).
  • Mistake: Ignoring terraform plan output → Fix: Review the plan to understand exactly what Terraform will change before applying.

Next step

In the next 10 minutes, create a new folder with a simple main.tf declaring one EC2 instance as shown above. Initialize Terraform, run plan to check for errors, then apply to deploy it. Then come back and try the next move from the video.

Your one action today

Pick the smallest version of this guide and try it in your tool of choice in the next 20 minutes.

Free download
Get the AI Career Starter Kit — 25 ChatGPT prompts + a 12-month plan
Click to get it →
Go deeper
AI Career Stack Starter Kit — $39
75 prompts + resume system + cloud roadmap + Notion template

Get the next AI/career guide in your inbox

One short, practical guide on AI tools, cloud, and the modern career stack. No fluff.

Related guides