Infrastructure change review
A plan is a proposal, not a deployment
A change review compares an intended change against known resource state. The goal is to catch mistakes before a tool starts creating, modifying or removing resources. A plan can be incomplete because of unknown values, provider behavior, permissions, quotas, concurrent edits or incomplete drift observation. A valid configuration is not proof of a safe plan; a safe-looking plan is not proof of a successful deployment.
A useful review sequence is: identify the environment and ownership, inspect the exact code revision and locked dependencies, perform static checks, request an authorized preview, review resource actions and data effects, obtain approval, execute only in the intended environment and verify actual application behavior. Core ByteMind exercises stop before any actual deployment.
Compare static checks with live previews
Static inspection checks file syntax, schema or policy assumptions without intentionally changing cloud resources. But initializing a Terraform provider, running a CDK program or invoking an untrusted plugin can execute code or access a network. Inspect dependencies and use an isolated approved workspace. Terraform plan, CloudFormation change sets, ARM/Bicep what-if and Infrastructure Manager previews can consult live infrastructure; permissions, side effects and costs depend on the operation. They are not interchangeable with local parsing. Terraform saved plans can contain sensitive data even when console output is redacted.
CloudFormation change sets may identify replacement or deletion. Drift-aware change sets can compare observed resources, but support is limited; immutable-property drift may require a separate decision. Azure what-if is a prediction, not a deployment guarantee, and its permissions are not simply anonymous read access. Never execute a preview against unknown credentials or an unapproved environment.
Inspect a fictional bookstore change
This normalized preview is deliberately invented, not the output format of any provider:
resource action reasonapp_pool update replicas 2 -> 3catalog_db replace incompatible storage settingarchive_bucket no-op unchangedThe extra replica is not the highest risk: replacing catalog_db could cause loss of data or downtime. Ask why the provider requires replacement, which dependent resources reference its identity, whether the old resource is retained, whether data is copied, what the recovery point and time objectives are, and how the application will switch endpoints. Do not proceed until a tested recovery or migration plan exists. A create-before-destroy strategy may temporarily require additional capacity and quota and may not be possible for fixed-name resources.
For fictional prices, three app VMs at $0.05 per hour for 720 hours cost $108. If old and new database instances at $0.20 per hour coexist for 10 hours, their combined overlap cost is $4, of which $2 is the additional instance cost over the one-instance baseline. These figures exclude storage, backups, transfer, taxes and other charges. Check overlap budget and capacity before requesting approval.
Handle drift, replacement and rollback
If a VM was resized manually, compare configuration, tool-recorded state and current observed values. A refresh-only Terraform plan can help inspect out-of-band changes and propose state reconciliation, but accepting observed state does not rewrite configuration. Decide on a single intended configuration, update it or plan to restore the previous setting, then generate a fresh preview. Do not casually edit state, remove resource bindings or force unlock; ownership and actual resource identity can be lost.
A rollback is a separate engineering action. Reverting a Git commit may restore a configuration but can trigger another replacement and cannot restore deleted database records. Use compatible application versions, verified backups, a tested data restoration procedure, explicit cutover criteria and a safe rollback window. Prefer reversible changes and small independently reviewed batches. Record the approved plan revision, intended environment and change window, but never commit sensitive state or plan files to source control.
Run a local review gate
The following Python function operates only on synthetic action labels and booleans. It does not parse provider plans, authenticate reviewers, validate actual backups or approve a deployment. fresh means the training scenario has already established that the plan matches the current revision and observations. reviewed is a supplied fact, not an identity check. In production, require evidence of every predicate, separate authorization and post-change validation.
def review_gate(actions, reviewed, fresh, recovery_verified, cost_ok): allowed = {"create", "update", "delete", "replace", "no-op"} if any(action not in allowed for action in actions): return "hold: unknown action" if not reviewed or not fresh: return "hold: review or stale plan" if any(action in {"delete", "replace"} for action in actions): if not recovery_verified: return "hold: destructive change" if not cost_ok: return "hold: cost" return "eligible for approval"
print(review_gate(["update", "replace"], True, True, False, True))print(review_gate(["update"], True, True, False, True))Expected output:
hold: destructive changeeligible for approvalThe first call detects replacement without verified recovery. The second is only eligible for a separate approval, not automatically authorized. Unknown action labels fail closed. Empty actions can still be eligible in this toy model; real reviewers must check the actual plan is complete and tied to the correct environment.
Practice and next steps
Review a change that replaces a private database, updates an application and creates a new network endpoint. Identify the data migration, permission and network exposure checks, cost overlap and rollback plan. If the plan was generated before another team changed the same resource, discard the stale preview and obtain a fresh authorized one. Next, Chapter 30 integrates these review decisions into a CI/CD delivery workflow.
Source anchors: Terraform plan, resource drift and sensitive data; AWS change sets and drift-aware change sets; Azure what-if; Google Cloud Infrastructure Manager previews. See the source register for the exact links and evidence boundaries.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Infrastructure change review — knowledge check
Choose the best answer for each offline scenario.
A preview proposes replacing a database. What should the reviewer do first?
A live resource changes after a preview is generated. What is the appropriate next step?
Two databases each cost a fictional $0.20/hour and coexist for 10 hours. What is the combined overlap cost?
Does a preview automatically prove a successful deployment?
What does eligible for approval mean in the Python gate?