StaffCoder
Terraform

Terraform Practice Exercises

Terraform 1.15Linux CLI
21 modules · 84 challengesSign up
Modules21 modules · 84 challenges
Write your first configuration and drive the init, plan, apply, destroy lifecycle with pinned providers.
Finish every challenge, or complete the star challenge, to complete the module.

Challenges

4 challenges

First Configuration Applied

Sign up to unlock
50%2 of 4 solvedeasy
About this challenge

Write a minimal configuration with pinned Terraform and AWS provider versions pointed at the local endpoint, and drive it through init, plan, apply, and destroy with a storage bucket as the managed resource - proving the plan previews before creation, a second plan is clean, and destroy leaves an empty state.

Solved in a browser IDE and graded by tests. Sign up to solve

Provider Pinning and the Lock File

Sign up to unlock
100%1 of 1 solvedeasy
About this challenge

Constrain the AWS provider with a pessimistic version constraint and create the dependency lock file, then demonstrate that re-initialization respects the locked version and hashes, a constraint excluding the locked version is refused, and an explicit upgrade moves the selection only within the constraint.

Solved in a browser IDE and graded by tests. Sign up to solve

Plan Before You Leap

Sign up to unlock
100%1 of 1 solvedeasy
About this challenge

Modify an existing configuration so one plan contains a create, an in-place update, and a replacement; read the plan to classify each action, apply the approved saved plan exactly, and prove that a stale saved plan is refused after the state moves on.

Solved in a browser IDE and graded by tests. Sign up to solve

Lifecycle Under Control

STAR
Solving it completes the module
100%2 of 2 solvedeasy
About this challenge

From an empty directory, build a pinned and locked configuration, then drive a create, an in-place update, and a replacement entirely through saved plans - proving idempotence between steps with no-change plans, capturing a stale-plan refusal after the state moves, and finishing with a complete destroy that empties state and endpoint.

Solved in a browser IDE and graded by tests. Sign up to solve

About this path

Master Terraform from your first configuration to advanced infrastructure management. Learn providers, resources, state, variables, modules, environments, secrets, dependencies, lifecycle management, and infrastructure changes through hands-on problems. Every challenge is verified against a real local AWS environment, giving you practical experience with how Terraform actually provisions, manages, and changes infrastructure.

This path starts with writing Terraform configuration: HCL and providers, then variables, outputs and locals. You work in a Linux terminal, so you should be comfortable running basic commands there. No earlier Terraform experience is needed. The variables module ends with a parameterized deployment driven by typed inputs.

Frequently asked questions

4

What will I practice in this path?

21 modules: HCL Fundamentals & Providers, Variables, Outputs & Locals, Resources & Dependencies, Data Sources & Expressions, Count, For-Each & Dynamic Blocks, State Basics, Modules Basics, Remote State & Backends, State Surgery & Refactoring, Workspaces & Environments, IAM & Policy as Code, Serverless Composition, Networking as State, Lifecycle, Conditions & Checks, Module Design & Reuse, Provider Aliases & Multi-Region, Secrets & Sensitive Data, Import & Brownfield Adoption, Zero-Downtime & Replacement Strategies, Automation & Plan Analysis and Testing & Integration Capstone.

How many Terraform exercises are there, and how hard are they?

84 exercises: 28 easy, 32 medium and 24 hard.

What does this path run on?

Challenges run on Terraform 1.15 and Linux CLI.

Do I need to install anything?

No. Every challenge runs in a browser-based IDE with everything already set up, and your code is graded automatically against a test suite.

We use cookies that are necessary to run Staffcoder, and optional analytics cookies to see which pages get used. Analytics stays off unless you accept. Read our Cookie Policy.