Should you migrate at all?
Many teams ask about moving from CloudFormation or ARM templates to Terraform because someone senior wants a single tool, or because a new hire prefers it. Those are weak reasons on their own. CloudFormation and Bicep are mature, supported by the cloud vendor, and they work. A migration costs engineering time and carries risk to running systems.
So this step is an assessment, not a conversion. We tell you whether a migration from CloudFormation to Terraform (or from ARM and Bicep) will pay back, which stacks to move and in what order. It is a contained piece of our Terraform and infrastructure as code service, and it sits next to our work on importing existing resources.
Good reasons to migrate
- Multiple clouds or SaaS providers that you want to manage with one workflow. Terraform providers cover Cloudflare, Datadog, GitHub and many more.
- Module ecosystem and reuse across teams, where versioned modules matter.
- Plan quality. Terraform’s plan output is detailed and reviewable, which suits pull request workflows.
- Consolidating tooling after acquisitions that left you with a mix of CloudFormation, ARM and Terraform.
- Hiring and skills, if your team already knows Terraform better.
Good reasons not to
- You are single cloud, small, and the templates are stable. The benefit is small.
- You rely heavily on AWS CDK or SAM and the team likes them. Those are higher-level tools over CloudFormation, and moving loses that productivity.
- A vendor-managed product deploys through CloudFormation, such as service-catalog based products, and fights you if replaced.
- There is a hard deadline for something else. Do not combine a migration with a critical launch.
We say so in the report when migration is not worth it. Sometimes the best recommendation is to leave the existing stacks and write only new infrastructure in Terraform.
How the assessment works
Inventory
We collect templates and live stack data. For CloudFormation that includes templates, parameters, nested stacks, stack sets, custom resources and drift status. For Azure it covers ARM or Bicep deployments by scope. For each we note the owner, how often it changes and what depends on it.
Scoring
Each stack gets a rating across a few dimensions, and a decision follows:
| Dimension | Why it matters |
|---|---|
| Holds data | Databases and buckets need retain policies and backups first |
| Complexity | Custom resources, macros and deep nesting have no direct Terraform equivalent |
| Change frequency | Frequently changed stacks benefit most from Terraform’s workflow |
| Blast radius | Foundational network and identity stacks need the most careful sequence |
| Ownership | Stacks owned by another team or vendor may be out of scope |
Approach per stack
There are three, and the report names one for each stack:
- Import in place. Terraform adopts the live resources. Best for stateful and long-lived infrastructure.
- Rebuild and cut over. New resources are created by Terraform and traffic or data moves across. Best for stateless layers that are easy to repoint.
- Leave alone. Not every stack needs to move.
What an in-place migration looks like
The sequence matters, and the order protects your data. First, on the CloudFormation side, set resources you care about to be retained, so removing the stack later does not remove them:
Resources:
OrdersDatabase:
Type: AWS::RDS::DBInstance
DeletionPolicy: Retain
UpdateReplacePolicy: Retain
Properties:
# existing properties unchanged
Update the stack so the policy is live. Next, write the Terraform and import the resource using an import block, iterating until the plan is empty:
import {
to = aws_db_instance.orders
id = "orders-prod"
}
Once Terraform owns the resource and the plan is clean, delete the CloudFormation stack. Because of the retain policy, the resource stays; only the stack’s record of it is removed. Always take a snapshot of critical data before touching the old stack, and double check that every resource you care about shows as retained.
On Azure, the equivalent flow is to import resources into state, check the plan, and then stop deploying the template to that scope. Be careful with deployment modes: complete mode deployments can remove resources absent from a template, so verify what the old pipeline will do before it runs again.
Decisions and trade-offs
Terraform or OpenTofu. Both read the same language, and the choice depends on licensing and ecosystem preferences. We cover your options in the report.
Rewrite quality. Straight translation reproduces the old structure, including its flaws. Migration is a chance to redesign into reusable modules, but redesign adds scope. We separate “move” from “improve” so one does not stall the other.
Coexistence period. For some time both tools will manage different parts of the estate. We define clear ownership boundaries so two tools never manage the same resource.
Failure modes we avoid
- Deleting the stack before retention is set, which deletes the resource.
- Nested stack and export dependencies that break when a parent stack is removed. We map cross-stack exports first.
- Custom resources and macros with no Terraform equivalent being discovered late.
- Importing without a state backup. See remote state setup.
A note on state and ordering
Stacks that export values to other stacks are the usual source of surprises. We migrate consumers before providers where possible, or replace stack exports with explicit data lookups first, so no stack is left pointing at an export that has vanished. Foundations such as VPCs and IAM roles go last in most estates, because everything else depends on them and the cost of a mistake is highest there.
Delivery and handover
The assessment delivers an inventory, stack ratings, a recommended order starting with a low-risk pilot, effort ranges, a risk register, and a written view on whether to proceed. If you proceed, the same team carries out the work. If not, you keep the plan.
How to tell the assessment was worth it
You can make a clear, evidence-based decision. The plan names a first stack and the checks that must pass before the second begins. To start, book a consultation and bring your list of stacks.