Terraform Plan Review Checklist: Catch Risky Infrastructure Changes Before Merge
A Terraform plan is evidence for a change review, not an approval by itself. This checklist helps platform and development teams identify destructive operations, permission changes, network exposure, data-store risks, provider behavior, and rollback gaps before infrastructure code is merged or applied.
Overview
Infrastructure as code makes cloud changes reviewable, repeatable, and easier to trace. It does not make every change safe. A small-looking variable adjustment can replace a resource, widen access to a private service, recreate a database, or alter dependencies that other workloads rely on.
A useful Terraform pull request review connects three things:
- The code change: what configuration, module, variable, provider, or state operation changed.
- The rendered plan: what Terraform intends to create, update, replace, or destroy.
- The operational context: why the change is needed, which environment it affects, and how the team will verify or recover from it.
Generate the plan from the same workflow that will apply it whenever possible. A common review pattern is:
terraform fmt -check
terraform init -backend=false
terraform validate
terraform plan -out=tfplan
terraform show -no-color tfplanUse the appropriate backend, workspace, variable files, permissions, and provider configuration for your environment. The exact commands should match your repository and CI/CD design. Do not treat a locally generated plan as interchangeable with a plan created by a controlled pipeline.
Before reviewing individual resources, confirm the plan is based on the intended commit, account or subscription, region, workspace, and variable inputs. A technically correct plan can still be dangerous if it targets the wrong environment. Teams that separate staging, preproduction, and production should make that environment boundary explicit in the pull request. See the staging vs. preprod vs. production environment strategy for a broader promotion model.
Checklist by scenario
1. Resource creation, updates, and destruction
- Count the resources to be created, modified, replaced, and destroyed. Do the totals match the stated purpose of the pull request?
- Investigate every
destroyand replacement operation. A replacement may appear as destroy-and-create, often represented in the plan as-/+or an equivalent replacement indicator. - Check for resources that are unexpectedly absent from the plan. A missing resource can indicate an incorrect module path, workspace, state selection, or variable value.
- For updates, identify whether the change is in-place or causes service interruption, recreation, or a temporary loss of capacity.
- Confirm names, tags, labels, ownership metadata, and environment identifiers remain correct.
Do not approve a destructive change solely because the plan is short. Review the reason for the change and the resource's recovery characteristics. If deletion is intentional, record the affected data, retention expectation, backup or snapshot evidence, and owner approval.
2. Dependency and ordering changes
- Look for changes to
depends_on, module relationships, data sources, and references between resources. - Ask whether Terraform will create or modify resources in an order that is safe for the application and its dependencies.
- Check whether a newly introduced dependency creates a cycle, delays deployment, or couples unrelated stacks.
- Review changes to shared modules and outputs for effects on downstream environments or repositories.
- Confirm that data sources resolve in the intended account, region, project, or cluster.
Dependency changes deserve extra attention when they affect networking, identity, encryption keys, DNS, load balancing, or shared state. A resource can be unchanged in the visible plan while its dependency changes the way it is reached or authorized.
3. IAM and access-control changes
- Identify every new role, user, group, policy, binding, service account, or permission attachment.
- Check the principals receiving access and the resources or actions covered by that access.
- Look for wildcard principals, actions, resources, or conditions. If a broad permission is necessary, require a documented reason and owner.
- Verify that a policy change does not grant administrative, write, impersonation, secret-reading, or cross-account access unintentionally.
- Check whether a removed permission will break deployment jobs, workloads, monitoring, or incident-response procedures.
- Confirm that secrets are referenced through an approved mechanism and are not rendered into plans, logs, or source control.
Review both additions and removals. Removing an unused permission can be a positive security change, but it may also interrupt a critical path if usage has not been verified. Pair the plan with the repository's access review process and, where available, policy-as-code checks.
4. Networking and exposure
- Check changes to security groups, firewall rules, network ACLs, routes, private endpoints, load balancers, listeners, and ingress controls.
- Compare source and destination ranges. Pay particular attention to changes from restricted ranges to broad or public ranges.
- Verify protocol, port, direction, and rule priority rather than reviewing only resource names.
- Confirm whether a subnet, endpoint, or load balancer changes the public or private reachability of a service.
- Review DNS, certificate, and listener changes for routing or termination effects.
- Ask whether network changes affect preproduction test dependencies or production traffic paths.
Network risk is often distributed across several resources. Review the complete path—from client or workload to service—not only the individual rule that changed. After approval, use deployment signals and observability to verify the expected path without exposing sensitive traffic. The preproduction observability guide provides a related verification approach.
5. Data stores and state-sensitive operations
- Identify changes to databases, tables, buckets, volumes, queues, caches, replicas, retention settings, and encryption configuration.
- Check for changes to backup, snapshot, point-in-time recovery, deletion protection, or retention behavior.
- Confirm whether an attribute change forces replacement or causes downtime.
- Review storage size, performance mode, replication, and failover changes for capacity and cost implications.
- Determine whether a migration is required outside Terraform and who owns that migration.
- Check for state moves, imports, removed resources, or address changes that could make Terraform lose track of an existing object.
Terraform state records relationships between configuration and remote objects; it is not a substitute for application data backups or a tested recovery plan. Treat state operations as high-attention changes, especially when they involve shared state, resource renames, imports, or removing an object from management.
6. Providers, modules, and generated changes
- Review provider and module version changes separately from functional resource changes.
- Check lock-file updates and confirm that the selected versions are intentional and reproducible in CI.
- Read upgrade notes or migration guidance when a provider change alters defaults, validation, resource behavior, or deprecation handling.
- Inspect generated plans for unexpected diffs caused by changed defaults, normalization, or computed attributes.
- Confirm that provider aliases still point to the intended accounts, regions, or subscriptions.
A provider upgrade can produce a large plan without a large configuration diff. Separate mechanical churn from meaningful infrastructure changes, but do not dismiss a broad diff until its cause is understood.
Risk comparison
| Risk level | Typical plan changes | Review evidence |
|---|---|---|
| Low | Tags, descriptions, noncritical in-place settings, or isolated development resources | Plan matches the request; ownership and environment are clear; no access, exposure, or data impact |
| Medium | Service configuration, dependency updates, capacity changes, internal network rules, or shared module updates | Dependency map, test evidence, impact window, monitoring plan, and an identified service owner |
| High | Database replacement, broad IAM changes, public exposure, encryption changes, state operations, or production destruction | Explicit approval, backup or recovery evidence, rollback or forward-fix plan, policy checks, and post-apply verification |
What to double-check before approval
Validate the plan's identity and scope
- Is the plan generated from the exact commit under review?
- Are the workspace, account, project, subscription, region, and variable files visible?
- Was the plan created with the permissions and backend configuration used for the eventual apply?
- Are unknown values expected, or do they hide an important decision?
Compare intent with impact
Read the pull request summary before reading the diff, then compare it with the plan. If the request says “add a private endpoint” but the plan also opens an inbound rule and replaces a route, stop and ask why. Reviewers should be able to explain each material action in plain language.
Check security and compliance controls
Run the repository's static analysis, policy-as-code, secret detection, and validation checks. These controls can flag patterns a human reviewer may miss, but a passing check does not replace contextual review. Confirm that policy results correspond to the same plan and inputs being approved.
Define verification and recovery
For every medium- or high-risk change, record how success will be observed: health checks, metrics, logs, connectivity tests, permission tests, or application-level validation. Decide whether rollback is realistic. Some database, permission, and schema changes are easier to correct with a forward change than by reverting the commit. Make that assumption explicit.
Use a consistent pull-request template
## Terraform change review
Environment and target:
Plan artifact or run link:
Terraform and provider versions:
### Intent
What problem does this change solve?
### Plan summary
Creates:
Updates:
Replacements:
Destroys:
Unknowns or deferred values:
### Risk checks
- [ ] IAM principals and permissions reviewed
- [ ] Network exposure and routing reviewed
- [ ] Data-store, backup, and retention impact reviewed
- [ ] Provider, module, and lock-file changes reviewed
- [ ] State moves, imports, or removals reviewed
- [ ] Policy and security checks passed
### Evidence
Test or validation results:
Backup or recovery evidence:
Monitoring and post-apply checks:
Primary approver:
Additional approver, if required:
Follow-up owner and due date:The template is useful only when reviewers attach evidence rather than checking boxes from memory. Keep the final plan artifact or CI run reference with the pull request so the approval remains auditable.
Common mistakes
- Approving from the summary alone: Totals do not reveal which resource is being replaced or which permission is being widened.
- Ignoring a destroy because it is expected: Expected deletion still requires data, dependency, and recovery review.
- Reviewing code without reviewing the rendered plan: Variables, defaults, provider behavior, and data sources can change the actual result.
- Assuming a successful plan means a safe apply: Plans can become stale when state, external resources, credentials, or inputs change.
- Treating state as disposable: State movement and imports can alter resource ownership in Terraform without changing the remote service immediately.
- Using overly broad test permissions: A plan generated with elevated local credentials may not represent the controlled deployment path.
- Leaving unknowns unexplained: Unknown values may be normal, but they should have a known source and an expected final behavior.
- Relying on rollback as a universal answer: Reverting infrastructure code may not restore data, permissions, external side effects, or irreversible provider operations.
For changes that support a deployment, connect infrastructure approval to the wider release process. Container image scanning and promotion gates, API contract testing, and preproduction test stability can provide complementary evidence before production impact.
When to revisit this checklist
Use the checklist for every infrastructure pull request, but revisit the checklist itself when the inputs around it change. Schedule a focused review before seasonal planning or other periods when capacity, traffic, or release volume is expected to change. Reassess it after adopting a new Terraform workflow, backend, module structure, provider, cloud service, policy-as-code tool, or CI/CD platform.
Run a quarterly review of access-related checks and high-risk approval rules. Also update the workflow after an incident, near miss, unexpected replacement, failed apply, or recovery exercise. Capture the missed signal and add it to the relevant scenario rather than simply adding another generic approval step.
Before your next merge, make the process concrete:
- Generate a plan from the controlled pipeline for the exact commit.
- Confirm its environment, identity, versions, inputs, and artifact location.
- Classify every create, update, replacement, and destroy action.
- Review IAM, networking, data stores, dependencies, providers, and state operations.
- Attach test, backup, policy, monitoring, and recovery evidence.
- Obtain the right owner approval, then verify the applied change against the expected outcome.
A careful Terraform plan review is not a search for a reason to block every change. It is a repeatable way to make risk visible, assign responsibility, and ensure that infrastructure changes are applied with evidence rather than assumption.