# Rebuild from zero

Everything the pipelines can't deliver, in the order a rebuild takes it: 105 manual steps in 14 groups, one page each. Each row names the identity that runs it, the command, why it isn't code, and the check that proves it worked. Everything else is a template the pipelines deploy on merge.

The scripts and templates live in the private repository; these pages name each one. [Planned steps and rebuild notes](/wiki/rebuild/notes/) lists what a rebuild drill still has to prove, because the environment was first built in a different order.

| Group | Covers | Steps |
| --- | --- | --- |
| [H-0](/wiki/rebuild/h-0/) | Workstation and repository | 3 |
| [H-1](/wiki/rebuild/h-1/) | Root, organization and Identity Center (console) | 8 |
| [H-2](/wiki/rebuild/h-2/) | Organization settings (CLI, no CloudFormation resource) | 4 |
| [H-3](/wiki/rebuild/h-3/) | Control Tower (master stacks) | 8 |
| [H-4](/wiki/rebuild/h-4/) | Workload accounts (repeat per account: shared-services, dev, prod, sandbox) | 6 |
| [H-5](/wiki/rebuild/h-5/) | Guardrails and the catalog (master stacks) | 8 |
| [H-6](/wiki/rebuild/h-6/) | The management account's own controls | 13 |
| [H-7](/wiki/rebuild/h-7/) | Security account | 19 |
| [H-8](/wiki/rebuild/h-8/) | Shared Services and the pipeline bootstrap | 9 |
| [H-9](/wiki/rebuild/h-9/) | The domain | 4 |
| [H-10](/wiki/rebuild/h-10/) | Build-period toggles | 2 |
| [H-11](/wiki/rebuild/h-11/) | Delivered by the pipeline (no manual step) | 0 |
| [H-12](/wiki/rebuild/h-12/) | Sandbox proofs (Stage 5) | 10 |
| [H-13](/wiki/rebuild/h-13/) | Findings review fixes (step 7.2) | 11 |

This is the complete list of actions that are not delivered by the pipeline, in the order a rebuild of the environment would take them. Everything else is code that the pipeline deploys (section H-11). It replaces the scattered records in `DECISIONS.md`, the Build Plan notes, the account docs and the session handoffs as the one place to look. The Master Build Plan stays as the history of how master was first built.

**Rule (DQ-88):** any change applied by hand adds or updates its row here in the same pull request: a change set Kyle runs, a script, a console toggle, a hand-made parameter or a time-gated delete.

## How to read it

- **Inputs, not values.** Account IDs, OU IDs, the organization and root IDs come from the organization at run time. Email addresses, the phone number, the admin user, the repository and the domain come from `scripts/hand/hand.env` (copy `hand.env.example`; the copy is git-ignored). Nothing in this file or in `scripts/hand/` is specific to one environment except the `hkb` names, and making those changeable is the follow-on project's work (DQ-89).
- **Identities.** *Root* is the management account's root user, at the console. *Bootstrap* is the temporary Bootstrap-Admin permission set (Day 0 only, until HKB-MasterAdmin exists; set `HKB_MGMT_ROLE=Bootstrap-Admin`). *MasterAdmin* is HKB-MasterAdmin in master (profile `hkb-master-mgmt`). *DomainAdmin* is HKB-DomainAdmin in master. *CT-Exec* is the Control Tower execution role in a member account, reached from MasterAdmin by the scripts. Claude never runs any of these (it reads as HKB-ReadOnly).
- **Change sets.** Each stack row is two commands: `plan` prints a change set and stops, and `exec <cs>` runs that one change set after review. A script's exit code is not the result: read the stack status and events afterwards, then run the check.
- **Region** is us-east-1 unless the row says both (us-east-1 and us-west-2).
- **Scripts** are `scripts/hand/*.sh`, run from the repository root with `bash scripts/hand/<name>.sh ...`. `master-stack.sh <stack> plan` is shortened below to `ms <stack>`.

