← all case studies

Case study 14 · featured

Environments you can create and destroy with one command

Impact
Entering a new region became an infrastructure change, not an infrastructure project.
My role
Led the architecture and implementation of the cell platform and its fail-closed teardown provider.
Evidence
One stack provisions the VPC, EKS, GitOps bridge, and network attachment; teardown verifies six ordered phases.
reliabilitycostdelivery

The situation

Standing up a complete environment — network, Kubernetes cluster, autoscaling, secrets, DNS, deployment pipeline — was a bespoke, multi-week effort.

Worse, tearing one down was genuinely dangerous: cloud environments are easy to create and surprisingly hard to delete completely, because components inside the cluster create cloud resources the infrastructure tooling doesn't know about. Half-deleted environments would linger, quietly billing money.

What I did

This is the work I consider my biggest win. I led the design and build of our take on cell-based architecture — an AWS-endorsed resilience pattern where, instead of one big shared environment, you run self-contained copies ("cells") so that any failure is contained to one copy (AWS describes it in its Well-Architected guidance on reducing scope of impact ↗).

Our main driver was speed into new markets: the ability to stand up a complete environment in a new region, quickly. But the same primitive serves more: developers can spin up an ephemeral cell to test something and throw it away, and a cell can be dedicated to a single customer where data residency demands it.

A cell is one Terraform stack that provisions everything — the VPC, the EKS cluster with its networking, IAM, DNS, and identity integration — and it joins the Cloud WAN network from case study 13 with one flag. Three design pieces I'm particularly proud of:

Every cell also registers itself in a central cell registry (a DynamoDB table) — the shared source of truth for what cells exist and how they're attached, consumed today by the secrets and network reconcilers, and designed to later feed a cell router that steers tenants and traffic to the right cell.

The interesting part

The teardown problem had no off-the-shelf solution, so I wrote a custom Terraform provider to close the gap. It walks an environment down in six ordered phases — preflight, freeze the deployment system, evacuate workloads, decommission autoscaled capacity, reconcile, verify — and it never pretends: if anything survived, it stops, reports failure, and names exactly what is still alive rather than letting leftover resources hide. It can even rehearse a destroy during planning and tell you what would be left behind.

What it changed

Each cell contains its own failure domain, teardown verifies that cloud resources are gone before state can disappear, and entering a new region is handled as a reviewed infrastructure change.