What to check in an infrastructure-as-code pull request
By OpenAna Engineering ·
A pull request that changes a module can look small while its plan touches several environments. A change to a default, a resource address or a provider setting can affect resources far from the edited lines. Review the proposal at three levels. First, find out what the author intended. Then compare it with what the plan will apply. Finally, check whether the team can verify and recover from the change in production.
Find the environment and the plan
Start with the workspace or stack, cloud account and region, commit, and identity that produced the plan. If the team uses multiple workspaces or internal accounts, confirm that every affected environment has its own evidence. A staging plan can reveal a module issue, while the production plan answers questions about production state and dependencies. Review the saved or pipeline-generated plan tied to the revision that will be applied. HashiCorp Terraform plan reference
Scan additions, changes, removals and replacements before reading every attribute. Ask what triggered a replacement and which dependencies it affects. For persistent storage or networking changes, record what the service owner considers recoverable and how they would restore it. If a plan shows an unrelated change, explain it or isolate it in a separate proposal so the reviewer can make a clear decision.
Translate the diff into an operational effect
Imagine a shared Terraform variable changes the minimum capacity of two worker pools. The expected effect is one pool scaling down after launch traffic subsides. A second pool runs time-sensitive jobs, so verify why the module default affects it and whether an environment-specific input would contain the change. Reviewers should see which queue can tolerate the adjustment, what the peak backlog looks like and whether the deployment can proceed one environment at a time.
Some checks require service context that the plan cannot express. A passing policy check might establish that the resource is in an allowed region. It cannot tell you whether a change will exhaust a downstream database connection pool. Pair each meaningful operational risk with a signal and an owner. If observability is missing, add the necessary instrumentation or arrange a supervised rollout with clear abort criteria.
Make approval and rollback concrete
| Review question | What to attach |
|---|---|
| What will apply? | Target workspace, plan tied to the commit, and explanations for unexpected resource actions. |
| Who owns the decision? | Service owner, infrastructure reviewer and recorded policy results. |
| What would stop rollout? | Named health metrics, a time window, a threshold and the person who can act. |
| How will the team recover? | A tested revert, restore, or forward-fix path suited to the actual resource and state changes. |
A revert commit may restore configuration while leaving state, persistent data or a deleted resource changed. Where that matters, document the recovery steps, test them in an appropriate environment and sequence the rollout so the first change is small enough to observe. After apply, attach the deployment run and the service health check to the same pull request or its linked ticket.
Review a change that affects two workspaces
Imagine two teams share a storage module. One wants to adjust the retention policy for a high-volume reporting workload. The proposed pull request changes the module default, so the other workspace also receives the new value on its next plan. The first review question is whether both teams agreed to that policy. If only one requested it, use a workspace-specific input and check the other workspace’s plan for a clean result.
Then check the order in which related systems rely on the setting. A shorter retention period can affect operational troubleshooting, replay jobs or restoration. Put those dependencies in the review and route the proposal to the data or service owner depending on who owns the retention requirement. If the team needs a staged transition, document which workload moves first and put the follow-up change in a separate pull request.
Check what recovery would actually mean. Restoring the original value could prevent future deletion, while recovery of data already removed may require a separate restore procedure. Review the data range the team intends to preserve and test the recovery path in an appropriate environment. For a high-impact change, have the owner verify that backups or archival copies are usable before the apply and identify when a review result expires.
Decide what evidence must block a merge
| Observation | Disposition |
|---|---|
| The plan was generated against the wrong revision or workspace | Request a fresh plan before approval. |
| A critical resource will be replaced | Require the owner to review the dependency impact, rollout and restoration plan. |
| An optional naming recommendation appears | Record the review observation and decide whether it belongs in this change. |
| The service health check is missing | Agree on the validation window, metric and owner before scheduling the apply. |
For teams handling many changes, these dispositions can form a repository checklist. Review one past incident where an approved plan had an unintended consequence. Add the missing dependency check, run it on a comparable pull request, and look for evidence that the check would alter a reviewer’s decision. Remove checklist items that only add clicks.
What the final review note should say
A useful approval names the revision, the environment it is approved for, and the conditions under which the decision still applies. If the underlying state changes, a new plan can have materially different effects even when the code is identical. Agree when to rerun the plan and which differences require another review. Put the approval where the owner, operator and later incident reviewer can all find it.
Keep the same record open through rollout. If production is healthy but a separate migration or backfill still needs verification, record that part as pending with its own owner. This prevents a successful apply from being mistaken for completion of every dependent task.
Try the workflow with OpenAna
The OpenAna IaC Engine is designed to prepare infrastructure changes for review and run policy checks before changes apply. For a pilot, take one historical pull request with an overlooked dependency and give the reviewer the same information they would have had on the day. See whether the new review catches the dependency, explains the plan, and gives the team evidence to make a decision. For changes made outside the pipeline, pair this checklist with our Terraform drift workflow.
Topics: Infrastructure as Code, Terraform, DevOps, Workflow guide