Skip to content
Best Cloud Resilience

Lesson 1 · MEASURE WHERE YOU STAND

How to measure infrastructure-as-code coverage before you need to rebuild

In short

Infrastructure-as-code coverage is how much of what a rebuild needs is defined in code you keep. Measure it by comparing the live inventory of one account with what your state files track, then sort the difference by what an application needs to run. A single hand-made IAM role can block a rebuild, so the list matters more than the percentage.

By The Recovery Desk · Best Cloud Resilience · Re-verified October 2026

2 min read

Why does coverage decide what you can rebuild?

A rebuild reproduces what is written down. AWS's guidance on cloud disaster recovery says that to recover in another Region you must redeploy the infrastructure, configuration and application code there, and it recommends infrastructure as code for exactly that reason. Anything that exists only in the live account has to be rebuilt by memory, during an incident, by whoever is awake.

What counts as covered?

A resource is covered when code in version control defines it and a state file, or the tool's equivalent, tracks it. Resources created in the console, by one-off scripts or by a tool that nobody imported are not covered, even if they never change. Neither are settings inside a covered resource that someone changed by hand: that is drift, the subject of the next lesson.

How do you count it?

Work one production account at a time.

  1. Export the account's resource inventory from the cloud provider.
  2. List the resources each Terraform or OpenTofu workspace tracks in its state.
  3. Match the two by resource identifier. What is in the inventory and not in any state is unmanaged.
  4. Sort the unmanaged list by its role in a rebuild: networks and routing first, then identity, DNS and security rules, then the services that use them.

Record the list, not only a count. Ten forgotten tags matter less than one hand-made role that every service assumes.

Where does the number mislead?

Some resources exist because the provider creates them by default and are not meant to be in code. Others are created by managed services on your behalf. And the configuration that a recovery depends on often lives outside the cloud account altogether: identity providers, DNS providers and SaaS settings rarely appear in cloud inventories. Lesson 5 covers those.

Which tools help raise coverage?

Three profiled products document turning unmanaged resources into code. ControlMonkey generates Terraform for resources not in code. Firefly codifies resources to Terraform, OpenTofu, Pulumi, CloudFormation and Crossplane. StackGuardian converts unmanaged resources into Terraform or OpenTofu. HCP Terraform runs and tracks code you already have; generating code from existing resources is not part of the pages we reviewed.

What should you take from this lesson?

  • Measure coverage per account, against what a rebuild needs, not against everything that exists.
  • Keep the list of unmanaged resources; it is your first remediation backlog.
  • Re-measure after every incident and every quarter, because coverage decays as people work.

Sources