🎓 A1Learner
🔍
0 of 50 lessons completed

Home / Terraform

Terraform

Infrastructure as code, from a first configuration to a three-tier app: HCL, core commands, variables, outputs, remote state, workspaces and modules — plus a VPC, an EC2 instance, IAM roles and a Lambda function. Every example run for real.

Terraform lets you describe infrastructure as code: servers, networks and databases written down in files, then created with one command. This course takes you from your first configuration to a three-tier app in the cloud, one short lesson at a time.

Start learning ❯❯50 lessons · 12 topics · 0/50 completed

Course contents

Work top to bottom — the sidebar is the course. Topics later in the list assume the ones before them.

What Terraform Is

Start: What Is Terraform? ❯

Install and First Project

Start: Install Terraform ❯

Core Commands

Start: terraform init ❯

Writing Configuration

Start: HCL: Blocks, Arguments and Attributes ❯

State

Start: What Is Terraform State? ❯

Environments

Start: Workspaces ❯

Expressions and Logic

Start: Functions ❯

Modules

Start: What Is a Module? ❯

Real Infrastructure

Start: Networks: A VPC ❯

Bringing Existing Infrastructure In

Start: Import Existing Resources ❯

Testing, Security and Pipelines

Start: Test Your Configuration ❯

Wrap-Up and Capstone

Start: Terraform Best Practices ❯

What you will learn

You will write configurations in HCL, plan and apply changes, manage state and workspaces, and build real infrastructure: a VPC, an EC2 instance, IAM roles and a Lambda function.

You will also learn the habits that keep real Terraform projects safe: locking state, keeping secrets out of files, and importing what already exists instead of rebuilding it.

By the end of the course you will be able to:

  • Write Terraform configurations in HCL
  • Plan, apply and destroy infrastructure with the core commands
  • Use variables, outputs, locals and functions
  • Store state remotely and lock it against concurrent changes
  • Split environments with workspaces
  • Write reusable modules and use modules from the Registry
  • Build a VPC, an EC2 instance, IAM roles and a Lambda function
  • Import existing resources and run Terraform in CI/CD

How the course works

Every lesson is short, with a focused example first and one exercise at the end. Every closing example was run for real on Terraform 1.17.1, and its stated output is the real output.

The examples that touch AWS run against a local AWS emulator on your own machine, not a live account, so nothing here costs money or creates real cloud resources. The one lesson that looks at a second cloud says so plainly and is read-and-understand.

Frequently asked questions

Do I need an AWS account to follow this course?

No. The lessons that create AWS resources run against a local AWS emulator, so you can follow along with no account and no bill. The course tells you where to point Terraform at the emulator, and where the same configuration would point at real AWS.

Can Terraform run in the browser on this site?

No. Terraform needs its own binary and a local emulator, so the Try-it box shows the verified output from a real run instead of running the commands here.

What version of Terraform do the examples use?

Terraform 1.17.1, with the AWS provider 6.72.0. The commands work on any recent Terraform 1.x version.

Is Terraform free?

Yes, Terraform is free to download and use. The course also covers the licence split that led to OpenTofu, so you know where the two projects stand.

Next steps