Environment, Workspace, and State Management
A focused chapter on environment, workspace, and state management, with practical delivery concerns, trade-offs, and the operational questions behind CI/CD work.
Why State and Environment Management Matter Before Your Infrastructure Breaks
Imagine you and a teammate are both managing the same server. You update the firewall config to open port 443. Your teammate, without knowing, changes the
Stop Mixing Environments: Why Your Dev and Prod States Should Never Touch
You have three directories: dev, staging, and prod. Each one holds configuration files, state records, and resource definitions. When you need to update a
Where Should You Store Your Infrastructure State? A Practical Guide
You have just finished writing a Terraform configuration that provisions a handful of servers and a database. You run terraform apply on your laptop, and
When Two People Change the Same Infrastructure State at the Same Time
Imagine this: Developer A and Developer B both need to update some infrastructure. They pull the current state from the same S3 bucket, each makes their
When One Infrastructure Config Has to Serve Multiple Environments
You have a Terraform configuration that defines your VPC, subnets, and load balancer. It works perfectly for your development environment. Now you need
Who Owns Production? Why Privilege Boundaries Matter Between Environments
A developer on your team makes a small change to a configuration file. They meant to update the staging environment, but they accidentally ran the command
When Your Infrastructure State Doesn't Match Reality
You set up your infrastructure as code. Terraform, Pulumi, or whatever tool you chose. Everything is tracked, versioned, and repeatable. Your state file
When Your Terraform State File Disappears: Recovery Strategies That Actually Work
You run terraform plan and instead of the usual output, you get an error. The state file is missing. Or corrupted. Or locked by a process that died hours