r/devops • • Sep 17 '26

Tools Migrating existing CloudFormation resources to OpenTofu -recommended approach?

Hi everyone,

We’re planning to migrate a large number of existing AWS resources currently managed through CloudFormation to OpenTofu.

Our environments are fairly siloed per customer, and each environment can include resources such as EC2 instances, load balancers, Auto Scaling Groups, VPCs, security groups, and other AWS services.

I’m looking for recommendations from anyone who has gone through a similar migration.

Specifically:

- Are there any tools that can help convert or migrate existing CloudFormation stacks to OpenTofu?

- What is the best approach for importing existing resources into OpenTofu state?

- How did you handle dependencies between resources during the migration?

- Would you recommend migrating one CloudFormation stack/customer environment at a time?

- Are there any common pitfalls or state-management issues we should watch out for?

- What approach would minimize the risk of OpenTofu trying to modify or recreate existing production resources after import?

Our main priority is to make the migration as safe and predictable as possible, with minimal disruption to existing customer environments.

Would appreciate hearing about any tools, workflows, or lessons learned from real-world migrations.

20 Upvotes

15 comments sorted by

View all comments

1

u/transendingAI Sep 26 '26

I would start with one small customer environment and keep its OpenTofu state separate. Inventory the resources, their physical IDs, and any references from other stacks before importing. Any generated HCL still needs checking against the deployed configuration.

The ownership handoff needs its own plan. Importing a resource into OpenTofu does not remove it from CloudFormation management. Test a retain-and-remove procedure for the relevant resource types before doing it in production, and avoid changes through either system during the handoff.

For the initial migration, aim for a plan with no resource changes. Investigate every proposed update or replacement rather than adding broad ignore_changes rules to hide differences. Cross-stack references and dependencies need checking even when each customer has separate state.