When AWS CloudFormation vs Terraform fits your team
Choose AWS CloudFormation when your estate sits almost entirely in AWS, spans a small number of accounts and regions, and your team is content to rely on a service AWS operates to store and run its stacks. Choose Terraform, or its open-source fork OpenTofu, when you run several clouds or many accounts, want to own state and run approvals yourself, or need one tool and one review process across providers. Three questions decide most cases: how many clouds and accounts you run, whether you want to own state and approvals, and how much of the estate sits in AWS. When all three point to AWS, CloudFormation is usually the simpler system to operate, and when they point elsewhere, the case for Terraform or OpenTofu gets stronger.
Check the license before you assume Terraform is free to run internally. The Terraform LICENSE file names IBM as licensor and applies the Business Source License 1.1 to Terraform version 1.6.0 or later. The grant allows production use and states that hosting or using Terraform for internal purposes within an organization is not a competitive offering. The restriction targets offering Terraform to third parties on a hosted or embedded basis in a way that significantly overlaps with IBM's paid versions. Each version converts to MPL 2.0 four years after it is published. Confirm the exact version you run with terraform version, and have counsel review the license against how you use it, especially if you operate infrastructure for customers.
Before you decide, list every cloud account, the state files you hold, who approves changes today, and what your renewal or license change actually affects. AWS states that one CloudFormation operation can manage resources across all AWS accounts and regions, which covers much of the multi-account case inside AWS, so confirm your account structure against the CloudFormation page before you rule it in or out. If most of the answers point to AWS and approvals already run through your version control system, CloudFormation is a reasonable baseline. If you need one workflow across clouds or must hold state yourself, plan for Terraform or OpenTofu with a separate run platform, and confirm that platform's license and hosting model before you commit.
Which scenarios favor each tool
This table matches common situations to the tool that usually fits better, and each row names the condition that makes that advantage hold. Read it against your own estate, team skills and licensing position before deciding. The main takeaway is that CloudFormation fits AWS-centric governance, while Terraform or OpenTofu fits multi-cloud estates and teams whose planned use is clear under the license.
| Scenario | Better fit | Why and the condition that holds it |
|---|---|---|
| AWS-only estate | CloudFormation | Advantage holds when all workloads, accounts and regions are in AWS and no other providers are needed. |
| Resources outside AWS | Terraform or OpenTofu | Holds when databases, DNS, SaaS or on-premises systems must sit in the same plan as AWS resources and the provider you need is available. |
| Self-managed state and run layer | OpenTofu with Terrakube or Atlantis | Holds when state, plan runs and approvals must stay on your own servers, and your team can operate the run platform. |
| Existing AWS-native governance | CloudFormation | Holds when your controls already rely on AWS-managed proactive checks and multi-account, multi-region operations that your assessors already review. |
| Planned use raises BSL questions | OpenTofu | Holds when a third-party or embedded offering is possible, since the Business Source License restricts competing paid offerings. |
| Internal-only Terraform use | Terraform | Holds when Terraform is used only inside your organization, since internal use does not count as a competitive offering. |
How to choose between the two paths
The path starts with whether the estate is AWS-only. If it is and the same workflow is not needed for resources elsewhere, the answer is AWS CloudFormation, an AWS managed service. Otherwise, the next question is whether the team must own state and approvals. If it does not, Terraform goes through license review. If it does, check whether the planned license use needs review. Terraform's Business Source License says internal use is not a competitive offering, but paid third-party offerings may be. Where review applies, Terraform follows that path. Otherwise the self-hosted route uses OpenTofu with Terrakube or Atlantis. Confirm the license reading with counsel.
Decision path from estate scope to CloudFormation, reviewed Terraform, or self-hosted OpenTofu.
How AWS CloudFormation and Terraform compare on capabilities
This table compares how AWS CloudFormation and Terraform handle core infrastructure as code capabilities during a platform review. Read the Terraform column alongside its run and state options, because Terraform is a CLI that teams pair with a platform for remote runs and state. Where the vendor record is silent, the cell names what to confirm in the vendor documentation, and the main takeaway is that CloudFormation is an AWS-managed service while Terraform's run and state layer is a choice you make.
| Capability | AWS CloudFormation | Terraform |
|---|---|---|
| Interfaces | Console, API, AWS CLI and AWS SDKs | Command-line CLI. Confirm the full interface list in the Terraform documentation. |
| Template model | Models and provisions AWS resources from a template as a stack | Configuration files processed by the CLI. Confirm supported providers in the Terraform documentation. |
| Version control | Templates can be used with version control to track changes | Configuration is plain files for version control. Atlantis runs plans from pull requests. |
| Multi-region reuse | The same template can provision the same resources in multiple regions | Confirm the multi-region pattern in the Terraform documentation. |
| Multi-account operation | One operation can manage resources across all AWS accounts and regions | Confirm how one run targets multiple accounts and regions in the Terraform documentation. |
| Pre-change checks | AWS-managed proactive controls check deployments before resources change | Confirm plan preview and policy checks in the Terraform documentation. |
| Drift handling | Confirm drift detection behavior in the AWS CloudFormation User Guide | Confirm drift handling in the Terraform documentation. |
| Run and state options | AWS manages the stack service, with no self-hosted option | CLI runs where you run it. Remote runs and state: HCP Terraform, Terraform Enterprise, or self-hosted Terrakube or Atlantis. |
| Hosting | AWS-managed service, not self-hosted | Runs in your own environment, with the run and state layer chosen separately |
What drives the bill for AWS CloudFormation vs Terraform
The AWS CloudFormation and Terraform bills come from different places. CloudFormation charges fall mostly on the AWS resources a template creates, plus handler fees for third-party and custom resource types. Terraform's license governs the CLI, while HashiCorp's per-resource meter applies to HCP Terraform, and Terraform Enterprise is quoted separately. Each card names what recurs, what is one-time, and what to request in a quote.
AWS resource charges
CloudFormation adds no charge for AWS::* and Alexa::* resource providers or managed hooks in the AWS::* namespace, so the recurring bill is the underlying AWS resources a stack keeps running. Instances, databases, load balancers and storage each bill on their own meters for as long as the stack exists. Reusing one template to provision the same resources in multiple regions adds to that footprint. Ask for a per-stack cost tag report, and review which resource types each template creates before a team adopts it.
Third-party and custom handlers
Third-party and custom resource types and hooks cost $0.0009 per handler operation after 1,000 free handler operations per month per account. Handler runs longer than 30 seconds add $0.00008 per second beyond that point. This recurs and scales with how often stacks create, update or delete those types, so a pipeline that redeploys often will see the charge first. Before adopting a registry extension, count operations from your deployment history and ask AWS to confirm how each run is metered.
CloudFormation pricingTerraform CLI license terms
The Terraform CLI is licensed under the Business Source License 1.1 for version 1.6.0 and later, with IBM named as licensor. Internal use inside an organization is permitted, but offering Terraform to third parties on a hosted or embedded basis that competes with IBM's paid versions is restricted. The cost here is counsel time at adoption and again whenever your use changes. Ask counsel to confirm whether a platform team serving several internal business units stays inside the grant. Each version converts to MPL 2.0 four years after it is published.
Terraform license fileHCP Terraform per resource fees
HCP Terraform bills paid tiers per managed resource per month: $0.10 on Essentials, $0.47 on Standard and $0.99 on Premium. This recurs every month and rises with the managed resources across your workspaces, so module design and workspace sprawl change the total. Request the managed resource definition, the feature list for each tier and any minimum commitment in writing before comparing. Confirm whether the published rates apply to your contract.
HashiCorp Terraform pricingEnhanced free tier limits
The legacy HCP Terraform Free plan reached end of life on March 31, 2026, and remaining organizations moved automatically to the enhanced Free tier. That tier allows up to 500 managed resources with unlimited users. The ceiling works as a recurring check, so track managed resource counts per workspace before a new project adds stacks. Confirm in writing what happens to your organization when the count passes that limit, and which plan your organization sits on today.
HashiCorp free tier postTerraform Enterprise custom quote
Terraform Enterprise is the self-managed edition, and HashiCorp lists its pricing as custom. The subscription recurs, and your side adds the servers, storage and staff time to patch, back up and upgrade the platform in your own infrastructure. Ask which metric the quote uses, what support is included, how renewals and price increases are handled and whether upgrades sit inside the subscription. Get those terms in writing before you size hardware.
What running each option takes from your team
With AWS CloudFormation, AWS runs the control plane that reads templates, creates stacks and tracks their state, so the work your team carries sits in three places: the templates themselves, the stack policies that guard resources against unintended updates, and the pipeline that deploys them. Templates are usually kept in a version control system, which gives reviewers a record of each infrastructure change. Your team also decides how deployments are triggered, whether from the console, the AWS CLI, the SDKs or a pipeline. Confirm which AWS-managed proactive controls apply to your deployments, and which of them your security team will treat as the approval gate, because those checks run before resources change and shape what your pipeline must do.
With Terraform, your team owns what AWS would otherwise run for you. That includes the state backend and its locking, the provider versions you pin, and the run platform that executes plans and applies. If you run OpenTofu, you also choose how state is encrypted, since OpenTofu encrypts state and plan files with key providers such as AWS KMS, which makes the key policy and rotation part of your operating model. Terrakube documentation describes a remote backend and cloud block, while Atlantis runs plans from pull requests, so the platform you pick determines who approves applies and where logs live. Confirm the license terms you will operate under before you standardize, because the Business Source License 1.1 applies to Terraform version 1.6.0 and later.
The effort in both models scales with the same four drivers: the number of stacks or workspaces, how often they change, how many approval steps sit between a pull request and a production apply, and how many AWS accounts and regions each one touches. CloudFormation can manage resources across accounts and regions from one operation, which may reduce per-account pipeline work, but the roles that operation assumes then need careful review. In Terraform, each additional workspace adds a state file to back up, lock and monitor, and each provider upgrade is a change your team must test. Before you request a quote, count these four drivers in your own estate and confirm them with your platform and security leads, since a few large stacks and many small ones create very different operating loads.
Where state and templates live, and what leaving involves
Both tools keep the definition of your infrastructure outside application code, but they store state and templates in different places. The cards below cover where that data sits, how state can be exported, which parts depend on a vendor, and what leaving each tool requires.
Where CloudFormation data lives
CloudFormation is an AWS managed service that runs inside AWS. Stacks, templates and the resources they create are handled in your AWS accounts and regions, and one operation can manage resources across all AWS accounts and regions. Terraform state sits in whichever backend your team configures, so its location depends on that choice. Check which accounts, regions and state backends hold production data, and who can read them.
State export through the API
HCP Terraform exposes each workspace's current state through its state versions API, and this is how state leaves the platform during a migration. A JSON state download is available for states created by Terraform 1.3 or later. Check which Terraform version wrote each workspace's state before you plan the export, since the download depends on it. Also plan how you will compare the exported state with the live resources before cutover.
State versions APIContract and API dependencies
This card applies only if your team uses HCP Terraform features beyond the state backend, such as remote runs, the private module registry or workspace-level run settings. Each feature in use needs a replacement or a documented decision in Terrakube or Atlantis, and you should confirm feature by feature which ones each platform covers. Review the subscription terms for notice periods and data return, and list every CI job or internal tool that calls the HCP Terraform API.
Client-side state encryption
OpenTofu encrypts state and plan files at rest for both local and remote backends, using a key provider. Supported providers include AWS KMS, GCP KMS and OpenBao, which lets your team keep key custody in its own cloud or secrets infrastructure. Losing access to the key means losing access to the state. Confirm key rotation, who holds key administration rights, and how Terrakube or Atlantis handles encrypted state before you rely on it.
OpenTofu encryption docsCloudFormation template exit work
Templates are often kept in version control, which records what changed in your infrastructure, and the same template can provision resources in multiple regions. Leaving means converting those templates to OpenTofu or Terraform configuration, then bringing the live resources under the new code without deleting them. Confirm with AWS documentation what happens to resources when a stack is deleted and how stack retention works. Plan the cutover so no stack is deleted while its resources are still in use.
CloudFormation user guideWhen an open-source route fits better than either product
A self-hosted route fits better in two cases. The first is when the team needs state files and run approvals to stay inside its own infrastructure, which a hosted run service may not allow for regulated workloads, so confirm where the hosted service stores state, plans and logs before you assume it meets that requirement. The second is licensing. Terraform version 1.6.0 and later fall under the Business Source License 1.1, with IBM named as licensor, and IBM completed its acquisition of HashiCorp on February 27, 2025. The license allows production use and internal use within an organization. It restricts offering Terraform to third parties on a hosted or embedded basis to compete with IBM's paid versions, and that competitive test covers paid support arrangements. If your plans include selling a managed service or paid support built on Terraform, have counsel review the license text for that specific use before you commit.
The open-source replacement has two parts, as HCP Terraform does. The first is the CLI, OpenTofu, which is licensed under MPL-2.0, sits under the Linux Foundation and was accepted to the CNCF Sandbox on April 23, 2025. It describes itself as a drop-in replacement for Terraform and aims for feature parity, but compatibility with future Terraform releases is not guaranteed, so test your providers and modules against both tools before they drift apart. The second is the run and state layer. Choose Terrakube if you want a remote backend and cloud block workflow, or Atlantis if your main need is running plans from pull requests. Both are licensed under Apache 2.0 and both document OpenTofu, so the choice depends on your review workflow and how much of the hosted experience your teams expect.
Running either stack moves operating work to your team. You host the run service, place SSO in front of it, back up state and schedule upgrades for both OpenTofu and the run platform. Two CloudFormation behaviors need explicit replacements. AWS-managed proactive controls check deployments before resources change, so you need a policy check in the pull request pipeline that blocks non-compliant plans. A single CloudFormation operation can manage resources across accounts and regions, so you need a cross-account role design and a pipeline that assumes the right role in each account and region. For state, OpenTofu can encrypt state and plan files on the client side with AWS KMS as a key provider, which keeps key control in your hands. Hosting and staff time recur, while design, migration and the first set of controls are one-time costs. Ask any implementation partner for a written list of these controls, their owners and the retest plan before you decide.
What a move between the two products involves
The move runs in a fixed order: inventory what exists, map each template to Terraform resources, back up and initialize the new tooling, bring live resources under management, verify clean plans, cut over pipelines, and only then retire CloudFormation stacks. Each step closes with a check a reviewer can confirm. Effort depends mostly on how many templates, custom resource types and cross-stack dependencies the estate contains.
Inventory stacks, workspaces and dependencies
The platform team lists every CloudFormation stack with its account, region and owner, along with nested stacks, custom resources and the exports that other stacks import. It adds any existing Terraform or OpenTofu workspaces, where their state is stored, and each pipeline that deploys these stacks. Effort grows with the number of accounts, regions and cross-stack imports, because each import ties two stacks together and both must move together. The step is done when a reviewed register assigns every stack a target workspace and a named owner.
Map each template to Terraform resources
Templates cannot run as Terraform code as written, so engineers translate each resource type by hand or with a conversion tool, then confirm that a matching Terraform provider resource exists and accepts the same properties. Where a CloudFormation resource type, macro or transform has no direct equivalent, the team decides between a provider alternative, a reusable module, or keeping that piece out of scope. Effort is driven by how many resource types, custom types and macros the estate uses. The step closes with a mapping document, reviewed by each owning team, that lists every resource and its Terraform counterpart with open questions marked.
Back up state and code, then initialize
Export each stack's template, parameter values and outputs, and store copies in version control alongside the stack's last known change set. Back up the current state of any existing Terraform or OpenTofu workspace before changing anything. If OpenTofu is the target, follow the sequence in the OpenTofu migration overview: back up state and code, install the OpenTofu binary, initialize each working directory, then verify. The platform team does this work, and the step is done when a backup has been restored in a test location and each workspace initializes without errors.
Bring existing resources under management
Each live resource is imported into its new state, either through import blocks in code or the import command, so the tool tracks it without recreating it. Freeze template changes for those resources while imports run, because two tools writing to one resource produce drift and conflicting updates. Set the deletion policy of each old stack to retain its resources, so that deleting a stack later cannot remove a database or bucket. The step is done when each workspace state holds the expected resource addresses and an engineer has checked a sample against the console or AWS CLI.
Verify plans show no unexpected changes
Run a plan against each imported workspace and read the output resource by resource. A clean result shows no creates, updates or replacements for resources nobody meant to change. Defaults, tags and provider-computed attributes often produce noise, so the team fixes the mapping or adds reviewed ignore rules, and never hides plan output. A second engineer signs off, and the saved plan output is kept as evidence. The step is done when repeated plans on unchanged code show no changes.
Cut over pipelines and test a small change
Point deployment pipelines at the new workspaces, with their credentials, approvals and logging moved across as well. Then make one small, low-risk change, such as adding a tag to a non-critical resource (illustrative), and run it end to end through the new pipeline. This is the final step of the OpenTofu sequence, testing with a small change. Effort is driven by how many pipelines call CloudFormation and how many approval and secret paths they use. The step is done when the small change applies once, the plan shows only that change, and no pipeline still runs a CloudFormation deploy.
Retire old stacks after verification
Keep each CloudFormation stack in its retained state until the team has confirmed that its resources are managed by the new workspace and that the cutover checks passed. Then delete the stack, confirm the resources still exist because of the retain policy, and archive the templates in version control for audit. Effort depends on how many stacks depend on exports from others, since a stack cannot be deleted while another stack imports its outputs. The step is done when the stack inventory shows none left and the register records each retirement.
Questions buyers ask before choosing AWS CloudFormation vs Terraform
Does Terraform cost anything to use under its license?
The Terraform CLI is licensed under the Business Source License 1.1 for version 1.6.0 or later, and that license grants production use for internal purposes within an organization. The license terms are only one part of the cost. Paid HCP Terraform tiers bill per managed resource per month, at $0.10 for Essentials, $0.47 for Standard and $0.99 for Premium, according to HashiCorp's pricing page, and Terraform Enterprise is custom priced. A self-hosted setup replaces those charges with your own hosting, run platform upkeep and staff time. Have counsel confirm the license terms against your use before you rely on them.
What drives the cost of CloudFormation custom resources and hooks?
Cost depends on how many handler operations your custom resource types and hooks run, and how long each handler runs. The AWS CloudFormation pricing page lists $0.0009 per handler operation for third-party and custom resource types and hooks, after a free tier of 1,000 handler operations per month per account. Handler duration beyond 30 seconds adds $0.00008 per second. Resource providers and managed hooks in the AWS::* namespace carry no additional charge, and you pay only for the underlying resources they create. The main levers are the count of custom resources in each deployment, the number of accounts (the free tier applies per account), and handlers that run long. Pull a recent month of handler activity from your accounts before sizing the work, and confirm current rates on the pricing page.
How long does moving off CloudFormation take in practice?
The duration depends on the size of your estate and on how much of it has to be rebuilt, tested and approved. The main factors are the number of stacks and resources in each, how many accounts and regions the templates span, the custom resources that need a replacement, and how much existing configuration history you need to preserve. Each stack needs its own cutover plan, verification step and rollback path, so the stack count usually matters more than the template line count. Approvals and change windows often set the pace more than the conversion itself. Ask for the timeline in the written scope, built from a full inventory, and check it against your change calendar before you commit.
Can our own team migrate off CloudFormation without an outside consultant?
Yes, if your team already runs infrastructure as code in production and has people who can own state, pipelines and rollback. The work breaks into conversion of templates to OpenTofu configuration, moving or re-creating state, building the run and approval path (Terrakube or Atlantis), and cutover with testing. Teams with strong AWS and Terraform skills often handle the conversion in-house, while the parts that are harder to staff are the run platform, the access model, and the documentation that compliance reviews ask for. Where the team lacks time or experience, a fixed-scope engagement with DeployOpen covers planning, implementation, hardening, backup and documentation, with scope, deliverables and timelines agreed in writing before work starts. Either way, keep the CloudFormation stacks running until the new path is verified, and make sure at least two people can read the new state and code.
What does the migration need from our side to start?
It needs a current inventory, access, named owners and agreed change windows before any conversion work begins. The inventory should list every stack, the resources and custom resource types in each, the AWS accounts and regions they run in, and the deployment pipelines that call them. Access means read rights to templates, stack events and deployment history, plus a sandbox account for testing, with the permissions your security team approves. Each stack needs a named business and technical owner who can sign off on cutover and rollback. Change windows should be booked with the teams that depend on each stack, because changes made during cutover can conflict with the move. Ask for this list in writing as part of the scope, since it determines the effort and the order of work.
Does the Terraform license block internal production use?
No. The license grant allows production use, and it states that hosting or using Terraform for internal purposes within an organization is not a competitive offering. The restriction targets offering Terraform to third parties on a hosted or embedded basis to compete with IBM's paid versions. The license defines a competitive offering as a product offered to third parties on a paid basis, including through paid support arrangements, that significantly overlaps with the capabilities of IBM's paid versions. IBM completed its acquisition of HashiCorp on February 27, 2025, and the license names IBM as licensor. If you build a product that you sell to customers and that embeds Terraform, have counsel test it against that definition in the Terraform LICENSE file. Each version converts to MPL 2.0 four years after it is published, so check which version you run.
Can we reverse the exit if the move goes wrong?
Yes, if you keep the old path running and the state backups intact until the new one is verified. Templates and configuration kept in version control let you redeploy an earlier version. For Terraform, HCP Terraform exposes each workspace's state through its state versions API, including a JSON state download for states created by Terraform 1.3 or later, so you can take a copy before you leave. Reversing a cutover is harder once the old stack has been deleted or changed, so keep the CloudFormation stacks and any Terraform workspace until the new path has passed its checks. OpenTofu does not guarantee compatibility with future Terraform releases, so a move back to Terraform later depends on the version you choose.
How DeployOpen helps you evaluate, move or run the chosen option
AWS CloudFormation is an AWS managed service, while Terraform is a CLI that has been under the Business Source License since version 1.6.0. DeployOpen plans, implements, hardens and documents whichever option you choose, inside your own infrastructure, with scope agreed in writing before work starts, so the boundaries are clear.
How we scope
- The written scope lists which CloudFormation stacks, Terraform configurations and state files are included.
- Scope also fixes the chosen target, such as OpenTofu with Terrakube or Atlantis, and where it runs.
- Engagements are fixed-scope, with deliverables and timelines agreed in writing before work starts.
How we build
- Set up OpenTofu for the CLI and a run and state platform in your own infrastructure.
- Configure remote state with encryption at rest through a key provider you choose, such as AWS KMS.
- Wire pull request plan and apply workflows, then test them with a small change before cutover.
How we hand over
- Documented runbooks for state backup, restore, key rotation and run approvals.
- Migration record showing what moved from CloudFormation or Terraform state, and what was rebuilt.
- Security test findings for the cloud and infrastructure layer, as agreed in the written scope.
How we support
- Ongoing support, upgrades and continuous testing are available under a retainer.
- OpenTofu aims for feature parity with Terraform, but future Terraform compatibility is not guaranteed, so budget for regular upgrade testing.
- Ask for the support boundaries, response expectations and upgrade cadence in the written quote.

