Skip to main content

14. Workspaces

Multiple state instances from one config; workspace vs directory separation.

⏱ ≈ 25 min this module · 📚 ≈ 5.8 h full track

🔒 Unlock this course to read the material and run the labs.

See options to unlock →
🔒 The written material unlocks with the course.
🧪 Hands-on lab Medium · 160 XP · 25min

Goal

Use terraform.workspace so the same config creates a differently named bucket per workspace.

Steps

  1. Name the bucket certland-labs-${terraform.workspace}
  2. terraform workspace new dev && terraform apply -auto-approve
  3. terraform workspace new prod && terraform apply -auto-approve

This must leave certland-labs-dev and certland-labs-prod created.

🔒 Unlock the course to run this lab.