← Terraform & Infrastructure as Code learning path
Terraform & Infrastructure as Code · Module 7 of 10

Environments and workspaces

Manage dev, staging and production.

📖 Key ideas

  1. Separate state per environment.
  2. Options: separate folders/backends per env, or workspaces.
  3. Use the same modules with different variable files.
  4. Production changes need review and approval.
  5. Tag resources with environment and owner.
💡 Real-life example: Environments are rehearsal rooms and the main stage: same play, separate spaces.
EnvironmentDev, staging or production setup
WorkspaceSeparate state in the same config
TagsLabels on resources
PromotionMoving changes from staging to prod