Cloud / IaC · Runbook
Adding a Region Without Destroying Anything
A runbook for adding an Nth cloud region to shared infrastructure that keeps every existing key, resource name, state path and secret untouched, plus the traps found in practice.
// Overview
Steps run in strict order: choose a region with zones and the required VM SKU, allocate CIDRs, apply platform connectivity, replicate the container registry in two phases, extend shared infra, configure each cluster, deploy workloads per cluster with separate state, then autoscaling. A companion design covers exposing Kafka through per-broker internal load balancers.
// The problem
Region strings are baked into names, map keys, DNS, secret paths and tool names. A wrong choice, or an un-keyed port of single-region code, makes Terraform destroy and recreate a whole regional stack.
// Flow
- Pick region firstzones, zone-redundant storage and the node SKU must exist
- Allocate CIDRsVNet, service and pod ranges, plus a small range for the registry satellite
- Platform connectivityper-region private DNS and peerings, applied first
- Registry phase 1disable endpoint IP pinning and apply; the plan must show in-place updates only
- Capture IPsread endpoints to map names to addresses
- Registry phase 2rewrite the pinned map, re-enable pinning, apply in the same sitting
- Gate: zero destroys gatemoved blocks re-key live resources; first plan must show no destroys
- Per-region cluster configone job per cluster with separate state
- Autoscaling and verifyregion-suffixed secrets feed the final stage
// Design decisions & guardrails
- Additive-only changes; never rename or repurpose an existing output.
- Key Vault data-plane resources depend on the private endpoint, avoiding a regional-looking 403 that is really an ordering bug.
- Explicit DNS records rather than zone groups, so two endpoints cannot overwrite each other.
- Providers cannot use for_each, so there is one root per cluster with its own state.
- Kafka design: a static reserved bootstrap address avoids an operator race; 7 internal load balancers (1 bootstrap, 6 broker).
// Outcome
A repeatable procedure with an explicit zero-destroy acceptance gate.