← All projects

terraforms

● HCL ★ 0 ⑂ 0 Last updated: July 4, 2026

terraforms

A hands-on, learning-oriented collection of Terraform examples, organized by provider/topic. Each folder is a small, self-contained project you can init, plan, apply, and destroy on its own.

Built as a study + reference repo while learning multi-cloud IaC (with an Azure / AZ-900 focus). Everything favors clarity over cleverness: heavy comments, standard file layout, and a short README per example.

⚠️ Cost warning. Most examples create real cloud resources that may cost money. Always run terraform destroy when you are done. Start with docker/ — it runs locally and is completely free.


Repository layout

Folder Provider What you learn
docker/ Docker (local) Terraform basics with zero cloud cost — start here
azure/ Microsoft Azure AZ-900 core services: resource groups, networking, compute, storage, PaaS
aws/ AWS S3 static site, EC2, VPC networking
digitalocean/ DigitalOcean Droplets, managed Kubernetes (DOKS), Spaces + CDN
cloudflare/ Cloudflare DNS records & zone management
kubernetes/ Kubernetes + Helm Deploy a Helm release with Terraform

Inside each provider folder, examples are numbered so you can follow them in order (01-..., 02-...), from the simplest building block upward.

Standard layout of an example

Every example uses the same file convention so the structure is predictable:

NN-example-name/
├── versions.tf              # Terraform + provider version constraints
├── providers.tf            # provider configuration (auth, region, ...) — when needed
├── main.tf                  # the actual resources
├── variables.tf             # input variables (with descriptions & defaults)
├── outputs.tf               # useful outputs after apply
├── terraform.tfvars.example # copy to terraform.tfvars and fill in — when secrets/inputs needed
└── README.md                # what it does, how to run, cost & cleanup notes

How to run any example

cd <provider>/<NN-example-name>

# 1. (if a terraform.tfvars.example exists) copy and fill in your values
cp terraform.tfvars.example terraform.tfvars
$EDITOR terraform.tfvars

# 2. download providers
terraform init

# 3. review what will be created
terraform plan

# 4. create it
terraform apply

# 5. TEAR IT DOWN when you're done (avoid surprise bills)
terraform destroy

Prerequisites

  • Terraform >= 1.5
  • Provider-specific CLI/credentials, documented in each provider's README:
    • Azure → Azure CLI (az login)
    • AWS → AWS CLI (aws configure)
    • DigitalOcean → a Personal Access Token
    • Cloudflare → an API Token
    • Docker → a local Docker Engine

Conventions & good habits shown here

  • Version pinning — every provider and Terraform core version is constrained in versions.tf, so init is reproducible.
  • No secrets in git — credentials come from environment variables or a local, git-ignored terraform.tfvars. See .gitignore.
  • Tagging — resources are tagged with a common tags/default_tags map so you can find and clean them up later (and to practice cost governance).
  • Outputs — each example prints the handful of values you actually need (IP, URL, connection string, ...).

A note on Terraform state

These examples use local state (terraform.tfstate on disk) to keep things simple for learning. State files can contain secrets, so they are git-ignored. In real/team setups you would use a remote backend (Azure Storage, S3 + DynamoDB, Terraform Cloud, ...) — that is intentionally left out here to keep each example focused on one idea.


Maintained by Çağatay Üresin. Licensed under MIT — see LICENSE.