Infrastructure as code as a cloud recovery asset, and where it stops

Short answer

Infrastructure as code lets you redeploy an environment from versioned files, which is why AWS and CISA both recommend it for recovery. It stops at four gaps: resources that were never codified, drift since the code was written, the data itself, and resources your tooling cannot manage. Recovery tools differ mainly in how they close those gaps.

Ranking current as of September 2026 · By the Cloud Resilience Vendors research desk

LESSON 4 OF 10 · BASICS · 26 May 2026

Why does official guidance recommend infrastructure as code?

In the backup and restore strategy, AWS's whitepaper on recovery options says you must redeploy the infrastructure, configuration and application code in the recovery region, and recommends infrastructure as code to do it. CISA's #StopRansomware Guide goes further for cloud: use infrastructure as code to deploy and update cloud resources, and keep backups of the template files offline so an attacker cannot change them.

The reason is simple. A versioned definition can be applied to a new region or a new account in a repeatable way, reviewed before it runs, and compared with what is running.

Where does infrastructure as code stop?

  1. Resources that were never codified. Anything created by hand or by another tool is outside the code. HCP Terraform, for example, can only rebuild what is already written in Terraform.
  2. Drift since the code was written. If production was changed outside the pipeline, the code describes an older environment. See the lesson on configuration drift.
  3. The data. Code recreates a database instance, not the rows inside it. A data backup is still needed.
  4. What the tooling supports. A resource can only be managed as code if the provider for that cloud or SaaS service supports it. Firefly's docs state that restoration depends on Terraform provider support.

What about the state file?

Terraform and OpenTofu keep a state file that records which real resources the code manages. HCP Terraform stores current and historical state versions and offers a rollback to a previous state version in its interface, and HashiCorp warns that doing so can orphan or duplicate resources. State history is useful evidence of what existed; it is not a restore of the resources themselves.

How do recovery tools close the gaps?

Each is a trade-off between reviewability and speed. The restore as code criterion in the ranking method scores how much of a recovery ends up as code you can keep.

What should you take from this lesson?

Infrastructure as code is the best starting point for a rebuild and an incomplete one. Before relying on it, measure how much of the estate is actually in code, and decide what covers the rest.

Sources

Related