IaC

Terraform Playground

Terraform by HashiCorp — write infrastructure as code using HCL to provision and manage cloud resources across 1,000+ providers..

Get access to the Terraform playground with one click

Welcome to the Terraform Playground!

HashiCorp Terraform 1.12 — the industry-standard Infrastructure as Code tool. Define, preview, and apply infrastructure changes with a declarative HCL workflow.

What’s Pre-installed

  • Terraform 1.12 with terraform and alias tf
  • Shell: bash with vim, nano, curl, wget, git, jq

Quick Start

terraform --version
tf --version

Common Workflows

# Initialise and apply a local resource
mkdir myinfra && cd myinfra
cat > main.tf <<'EOF'
terraform {
  required_providers {
    local = { source = "hashicorp/local", version = "~> 2.5" }
  }
}

resource "local_file" "hello" {
  content  = "Hello from Terraform!"
  filename = "/tmp/hello.txt"
}
EOF

tf init     # download providers
tf plan     # preview changes
tf apply -auto-approve
cat /tmp/hello.txt
tf destroy -auto-approve

Advanced Tips

# Variables and outputs
cat > variables.tf <<'EOF'
variable "message" { default = "world" }
EOF
cat > outputs.tf <<'EOF'
output "greeting" { value = "Hello, ${var.message}!" }
EOF
tf apply -auto-approve
tf output greeting

# State management
tf state list
tf state show local_file.hello
tf show

# Workspace
tf workspace new staging
tf workspace list

Session Notes

  • Session lasts 1 hour.
  • No cloud credentials needed — use the local provider to practice core Terraform concepts.