What if the tool you pick to define your cloud today quietly becomes the thing that locks you in tomorrow? That question sits at the heart of the Terraform versus CloudFormation debate, and in 2027 it is sharper than ever. Both tools describe infrastructure as code. Both can spin up a VPC, a database, or a fleet of containers. But they make very different assumptions about who owns your state, how portable your work is, and how much legal risk you are willing to carry. This article walks through the architecture decisions that actually change outcomes, not just the marketing bullet points.
The Core Split: Provider Model vs. Native Service
Terraform is a general-purpose, provider-based tool. Its power comes from a plugin ecosystem that talks to hundreds of platforms through a shared language called HCL. CloudFormation is AWS’s own infrastructure-as-code service, and it only speaks AWS. That sounds like a simple scope difference, but it shapes everything downstream.
When you build on Terraform, you are betting that your infrastructure will touch more than one cloud, or at least that you want one workflow for AWS, GitHub, Cloudflare, and your database vendor. When you build on CloudFormation, you are betting that deep AWS integration is worth more than portability. Neither bet is wrong. The mistake is making it by accident.
A practical rule from teams that have done both: if more than a small slice of your estate lives outside AWS, Terraform usually wins on operational sanity. If you are all-in on AWS and plan to stay there, CloudFormation’s native hooks into new services often arrive first.
State Management Is the Decision Nobody Talks About Enough

Here is the architectural difference that bites people late. Terraform keeps a state file that records what it believes exists. That file can live locally or in remote storage, and it must be locked and shared carefully so two engineers do not trample each other. CloudFormation keeps stack state server-side inside AWS, so you never babysit a file.
The Terraform state model is powerful and dangerous in equal measure. Remote state with locking is non-negotiable for teams. Losing or corrupting state is the classic self-inflicted outage, and it usually happens because someone ran a plan from a laptop against production. If you are designing remote backends, the same discipline that goes into cloud storage architecture that actually works with objects and erasure coding applies to state: version it, restrict access, and treat it as production data.
CloudFormation removes that burden but hands control of state to AWS. You trade operational overhead for a degree of opacity. When a stack gets stuck, you are often waiting on the service rather than debugging your own backend.
Drift Detection and the Reality of Live Environments
Infrastructure drifts. Someone patches a security group by hand at 2 a.m. and forgets. Both tools can catch this, but differently. CloudFormation has offered drift detection for years, comparing the live resource against the template. Terraform relies on refreshing during `terraform plan`, and commercial offerings add scheduled drift checks. (Introduction to Terraform (HashiCorp docs))
In practice, drift detection is only useful if someone reads the output. A common mistake is enabling it and never wiring the results into an alert. The better pattern is to run plans on a schedule in CI and fail loudly when reality diverges from code. That habit matters more than which tool you chose.
Licensing, Forks, and the 2027 Risk Question
This is where 2027 looks genuinely different from 2022. In August 2023, HashiCorp moved Terraform from the Mozilla Public License to the Business Source License. That change rattled enterprises and sparked the OpenTofu fork, which is now stewarded as an open-source alternative under permissive licensing.
Then came consolidation. IBM completed its acquisition of HashiCorp in early 2025, which leaves an open question about the long-term licensing and roadmap direction for Terraform itself. Nobody can say with certainty how that plays out by 2027, and anyone who claims otherwise is guessing.
So the architecture decision becomes a governance decision. Ask three questions:
- Does our legal team accept BSL terms for the scale we operate at?
- Could we migrate to OpenTofu if licensing tightened, and what would that cost?
- Do we need a vendor contract with support, or is community support enough?
CloudFormation sidesteps the license debate entirely because it is part of AWS. You pay for AWS, and the tool comes along. For regulated industries that hate surprise licensing exposure, that simplicity has real value.
Language, Tooling, and the Developer Experience Gap
Terraform uses HCL, a readable configuration language. CloudFormation uses JSON or YAML templates, which get verbose fast. AWS also offers the Cloud Development Kit, which lets developers define infrastructure in TypeScript, Python, or Java and synthesizes CloudFormation behind the scenes.
The developer experience difference shows up in review culture. HCL diffs are usually easy to read in a pull request. Large YAML templates are not. Teams that adopt the CDK often find their application developers more willing to contribute, because they are not learning a new DSL.
Testing tells a similar story. Terraform has `validate` and `plan`, plus a mature third-party ecosystem for policy checks and integration tests. CloudFormation has `cfn-lint` and change sets. Both are workable. The deciding factor is usually which one your platform team already knows, because tooling fluency beats theoretical superiority every time.
Multi-Account and Multi-Region Architecture
Most growing organizations end up with many AWS accounts. CloudFormation handles this natively through StackSets, which deploy a template across accounts and regions in one operation. Nested stacks let you compose large systems from smaller templates.
Terraform handles the same problem through modules and separate state per account, often orchestrated by a pipeline. It is more flexible and more work. If your organization is structured around AWS Organizations and you want guardrails that feel native, CloudFormation’s multi-account story is smoother out of the box.
This is also where the broader networking picture matters. Multi-account designs usually mean shared VPCs, transit gateways, and cross-account connectivity, and getting those right is its own discipline. The way cloud networking architecture and virtual networks actually work shapes how you split infrastructure across accounts, and that split in turn dictates whether StackSets or Terraform workspaces fit better.
Where Each Tool Fits in a Modern Platform
A pattern that keeps showing up in mature organizations is deliberate mixing. CloudFormation or the CDK handles AWS-native foundations where deep integration matters, and Terraform handles the multi-cloud edges and third-party services. The trick is drawing a clean boundary so the two do not fight over the same resources.
That boundary is an architecture decision in itself. Overlap is where outages hide. Pick one owner per resource type and write it down.
If your platform also involves service mesh, API gateways, or container orchestration, the same layering logic applies. Teams often find that cloud native computing architecture and how it actually works in practice clarifies which layer should own which resource, which then tells you whether that layer belongs in a Terraform module or a CloudFormation stack.
Common Mistakes That Cost Real Money
A few patterns show up again and again, regardless of tool choice.
Treating state as an afterthought. No locking, no versioning, no backups. This is the single most common cause of Terraform pain.
Ignoring blast radius. One giant stack or one giant state file means every change risks everything. Split by lifecycle and by team.
Skipping policy as code. Manual review does not scale. Automated checks catch the misconfigured bucket before it becomes a headline.
Assuming the tool prevents mistakes. It does not. A well-structured repository with clear ownership prevents more incidents than any DSL choice.
Forgetting the exit plan. Whatever you pick, document how you would migrate. That single exercise reveals how much lock-in you are actually accepting.
A Decision Framework for 2027
Rather than asking which tool is better, ask which constraints dominate your organization. The table below frames the trade-offs honestly.
| Decision axis | Terraform | CloudFormation |
|---|---|---|
| Cloud scope | Multi-cloud via providers | AWS only |
| State ownership | You manage remote state and locking | AWS manages stack state |
| Licensing | BSL, with OpenTofu as a fork | Included with AWS |
| Multi-account rollout | Modules plus pipelines | StackSets and nested stacks |
| Language | HCL | JSON/YAML, or CDK in real languages |
| Drift handling | Plan refresh plus scheduled checks | Built-in drift detection |
| Ecosystem breadth | Very wide, third-party heavy | Deep AWS, narrower outside |
If multi-cloud or vendor neutrality tops your list, Terraform or OpenTofu is the natural fit. If deep AWS integration, minimal operational overhead, and zero licensing ambiguity top your list, CloudFormation wins. If you are somewhere in between, a documented split is a legitimate architecture, not a cop-out.
One more consideration deserves honesty: predictions about 2027 are speculative. Licensing terms, feature parity, and roadmaps can all shift. Build your decision on current constraints and a clear migration path, not on a forecast you cannot verify.
Conclusion
The Terraform versus CloudFormation question is not really about which tool is more powerful. It is about which trade-offs your organization can live with for the next three years. Terraform offers breadth and flexibility at the cost of state management and licensing complexity. CloudFormation offers native integration and simplicity at the cost of portability. The teams that get this right do three things: they name the trade-off explicitly, they keep state and blast radius under control, and they write down how they would switch if circumstances changed. Do that, and either tool will serve you well. Skip it, and you will inherit lock-in you never consciously chose.
Frequently Asked Questions
Can Terraform and CloudFormation be used together in one organization?
Yes, and many do. The workable pattern is to assign clear ownership per resource type so the two tools never manage the same resource. Overlap causes conflicting changes and confusing drift. Document the boundary in your platform standards.
Is CloudFormation free to use?
CloudFormation itself does not carry a separate license fee. You pay for the AWS resources it provisions. That simplicity is one reason regulated organizations lean toward it, since there is no separate licensing review.
What happens to Terraform under IBM ownership?
The acquisition completed in early 2025, but the long-term roadmap and licensing direction remain uncertain. Teams should treat this as an open risk and keep a documented migration path, whether to OpenTofu or to a native alternative, rather than assuming the status quo holds.
How hard is it to migrate from CloudFormation to Terraform?
It depends on scale. Small stacks can be recreated in HCL in days. Large estates with hundreds of stacks take months, because you must import existing resources into state, verify no drift, and retrain teams. The migration itself is usually less risky than the years of undocumented manual changes hiding inside old stacks.
Which tool handles drift better?
CloudFormation has built-in drift detection that compares live resources to the template. Terraform relies on plan refreshes and scheduled checks, often in CI. Functionally both can catch drift, but only if someone acts on the results. Wiring detection into alerts matters more than the feature itself.
Does the Business Source License mean Terraform is no longer open source?
The BSL is source-available but not OSI-approved open source, which is why the OpenTofu fork emerged under permissive licensing. For most users the practical question is not the label but whether the terms fit their scale and legal posture. That is a conversation to have with legal before, not after, adoption.


