Skip to content

Runbook

Day-2 procedures for operating a deployed landing zone. The rest of this section covers the happy path: Plan and apply, Drift detection, and The gates. The runbook covers everything else, one procedure per page, including the cases where a run stops half way.

Symptom-level fixes for a failing job live in Troubleshooting. The runbook carries the full procedures.

Procedure When
Clearing a stale state lock An apply fails with Error acquiring the state lock after the five-minute wait.
A half-failed apply A dependency-ordered apply stopped at one unit and skipped the rest.
Moving or renaming a unit A folder move would orphan the unit's state.
Decommissioning a unit A unit's resources must be destroyed, or its folder removed, without leaving anything behind.
Importing existing resources Resources that already exist in Azure must come under management without being recreated.
AMBA remediation The foundation is applied but the AMBA alerts have not been deployed.
Diagnostic settings remediation The foundation is applied but resources that predate it, such as the runner environment, send no logs.
Rotating credentials A checks App key, runners App key, Infracost key, or bootstrap PAT must change.
Teardown and decommissioning A customer environment is being removed, in the only order that works.

Adding a workload is not a runbook procedure. It is the everyday change, and Add a workload unit carries the copyable tree and the rules a unit follows. Drift is triaged on Drift detection.

Throughout, "unit" means a Terragrunt unit, a leaf folder with a terragrunt.hcl. The PR-ops engine (nrit-tfpr) calls the same thing a project, so its labels, checks, and -p selector use that word.

The change process

Every change is a pull request; there is no local apply. (The ops workflow has a workflow_dispatch button for plan, apply, and unlock, but it requires a PR number: it drives an existing pull request, it does not replace one.)

  1. Branch, edit the unit, open a PR. The engine plans every impacted unit and posts the plan as a comment, with the policy, security, and cost gate output.
  2. Read the plan. The gate panel expands on its own when a gate has a finding.
  3. Get the required approval, then comment tfpr apply. The engine applies the changed units in dependency order and posts a report comment for each.
  4. tfpr / merge-gate goes green once the applied set matches what the PR changed. Merge.

The merge gate stays red if the PR touched Terraform but no unit was selected, so a net-new unit cannot merge without being applied. If that happens, the unit path is wrong or missing from projects.yml. A unit deleted on the branch is invisible to selection in the same way, so the engine compares the base branch's inventory and plans the removed unit's destroy from the base branch. tfpr apply -p <unit> destroys it; merging without applying keeps it. See Decommissioning a unit.

Full detail is in Plan and apply.