Picture a typical estate we inherit. The Azure subscription has a few Bicep files nobody has run in months. The AWS account has three CloudFormation stacks from 2019 and a lot of resources created by hand in the console. And a contractor left behind a Terraform folder with a terraform.tfstate file committed to Git.
Nobody needs convincing that infrastructure as code is the right idea. The fight is over which tool. Picking the wrong one won't sink you, but it's sticky: modules, pipelines and habits build up around it, and switching later is a project of its own.
So let's compare Terraform, Bicep and CloudFormation on what actually decides it for an engineering lead: state, drift, the skills you already have, whether you're genuinely multi-cloud, and licensing.
Infrastructure as code is the foundation for everything else
Repeatable environments, reviewable changes, cost controls and disaster recovery all depend on being able to recreate infrastructure from version-controlled definitions. AWS's disaster recovery guidance says that without IaC, restoring workloads in a recovery Region may be complex and lead to increased recovery times, possibly beyond your recovery time objective.
The tooling picture has also shifted. On 10 August 2023 HashiCorp announced that future releases of its products would move from the Mozilla Public License 2.0 to the Business Source License 1.1, which restricts use in offerings that compete with HashiCorp. The community responded with OpenTofu, a fork that describes itself as a drop-in replacement for Terraform under Linux Foundation stewardship. IBM then completed its acquisition of HashiCorp on 27 February 2025. For most companies running Terraform on their own infrastructure the licence change doesn't stop anything, but it now belongs in any long-term tooling decision.
The three tools in one paragraph each
Terraform is HashiCorp's declarative tool, written in HCL. It talks to clouds and SaaS platforms through providers, and it keeps a state file recording what it manages.
Bicep is Microsoft's language for Azure. It compiles to Azure Resource Manager JSON and, per Microsoft, immediately supports all preview and GA resource types and API versions as soon as a resource provider ships them.
CloudFormation is the native AWS service. You describe resources in YAML or JSON templates, and CloudFormation provisions them as a stack you can manage as a single unit. The AWS CDK lets you write the same thing in TypeScript, Python and other languages, then synthesises it to CloudFormation.
Terraform vs Bicep vs CloudFormation, side by side
| Factor | Terraform | Bicep | CloudFormation |
|---|---|---|---|
| Cloud scope | Multi-cloud and SaaS via providers | Azure only | AWS only |
| State | State file you must store, lock and protect | No state file: Azure holds it | Held by the service as stacks |
| Preview changes | terraform plan | what-if | Change sets |
| Drift handling | Shown on plan; -refresh-only to inspect and reconcile | what-if compares with the live environment | Built-in drift detection on stacks and resources |
| New service support | Waits on provider releases | Immediate for new Azure resource types | Waits on CloudFormation resource coverage |
| Language | HCL | Bicep | YAML or JSON (or CDK in general-purpose languages) |
| Licence and cost | BSL 1.1 (OpenTofu fork is open source) | Free and open source | Native AWS service |
State is the biggest practical difference
Terraform can't work without state. HashiCorp's docs explain that it maps real-world resources to your configuration, tracks metadata and speeds up large deployments. By default it's a local terraform.tfstate file, which is fine for one person and fragile for a team, so HashiCorp recommends HCP Terraform or a remote backend. The same page warns against keeping state in version control or anywhere without locking and access control, because it can expose secrets stored in it.
That committed terraform.tfstate in our opening example? Treat any database passwords or keys in it as leaked and rotate them. Then move state to a locked backend, such as an S3 bucket with versioning and locking enabled, or an Azure Storage container, and restrict who can read it.
Bicep and CloudFormation skip all this. Microsoft lists no state or state files to manage as a benefit, since Azure stores it. CloudFormation tracks resources in stacks inside the service. For a small team on one cloud, not running a state backend with its own locking and access policies is a real saving.
Drift: when the console wins
Drift is what happens when someone changes infrastructure outside the tool, usually at 2am during an incident. All three tools can show it, differently.
Terraform refreshes state against reality on every plan and apply. HashiCorp's resource drift tutorial uses terraform plan -refresh-only to review changes made outside Terraform, and points out that a normal plan or apply would try to revert them. If the manual change was the right fix, update the code first, then apply.
CloudFormation has explicit drift detection for whole stacks or single resources. Read its limits before you trust a green result: it only compares properties set explicitly in the template or parameters (not defaults), it doesn't check nested stacks when you check the parent, and resource types without drift support come back as NOT_CHECKED.
Bicep's what-if compares a planned deployment with the current environment, so differences show up before you deploy. Whatever the tool, the real fix is process. Restrict console write access in production and get emergency changes back into code within a day or two.
Which one fits your team
Bicep if you're firmly on Azure. The syntax is approachable, new Azure features work on day one, there's no state, and it integrates with Azure Policy and template specs.
CloudFormation or the CDK if you're firmly on AWS and want a native service with stack rollback and drift detection. Teams with solid TypeScript or Python skills often prefer the CDK for its abstractions and unit testing.
Terraform or OpenTofu if you really do manage more than one cloud, or a lot of SaaS configuration: DNS, monitoring, identity, source control. One language across all of it is worth a lot. Be honest about "multi-cloud", though. If 95% of the estate is in one cloud, the native tool may serve you better, with Terraform only where it adds something.
Six questions settle most of these debates:
- Which clouds and SaaS platforms will we manage in the next three years?
- Where will state live, and who can read it?
- How will changes be previewed and reviewed before apply?
- How will we detect and correct drift?
- What skills does the team have now, and who will maintain the modules?
- Do licensing or procurement rules constrain the choice?
How JRC Software implements IaC
Week one is an audit. We list what's managed in code and what was clicked together, find where state and templates live (including any copies on laptops), and check for secrets in state or repositories. You get a short report with the tool we recommend for your footprint and the order to bring things under management.
Then we do the work with your team. Existing resources come under management through terraform import or import blocks, CloudFormation resource import, or Bicep templates written to match what's deployed, not by rebuilding them. Every change goes through a pipeline that plans, waits for review and applies. We add the guard rails that make it stick: remote state with locking and tight access for Terraform, scheduled drift checks, reusable modules and policy checks in the pipeline.
One rule we hold firm on: never run two tools against the same resource, and don't migrate everything at once. This work often comes first in a legacy modernisation programme and underpins cloud resilience and disaster recovery, because you can't quickly recover what you can't redeploy. Larger teams often package the modules into an internal platform (see platform engineering vs DevOps). It's a core part of our cloud engineering and modernisation service.
Still choosing between Terraform, Bicep and CloudFormation, or stuck with a mix of all three? Talk to a cloud engineer and we'll recommend a tool and a migration path that fits your team.
Frequently asked questions
Is Terraform better than Bicep?
Neither is better across the board. Bicep is usually the stronger pick for Azure-only teams because it supports new Azure resources immediately and has no state file to manage. Terraform wins when you manage several clouds or many SaaS platforms and want one language and workflow. Decide on your cloud footprint and your team's skills.
Do I need to worry about the Terraform licence change?
Probably not, if you use Terraform to manage your own infrastructure. HashiCorp moved future releases to the Business Source License 1.1 in August 2023, and the main restriction is on offerings that compete with HashiCorp. If you're a vendor, have strict open-source policies or want community governance, OpenTofu is a fork built as a drop-in replacement. Check with your legal team if unsure.
What is infrastructure drift?
Drift is the gap between what your infrastructure as code says should exist and what actually exists, usually caused by manual changes in a cloud console. It makes deployments unpredictable and can undo an emergency fix on the next apply without anyone noticing. All three tools can surface drift, but preventing it depends on limiting manual changes and feeding urgent fixes back into code.
Can we migrate from CloudFormation to Terraform, or the reverse?
Yes. Both tools can adopt existing resources through import, so nothing needs rebuilding. Most of the effort goes into mapping resources, rewriting templates and confirming the new tool plans no unexpected changes. Migrate one stack or environment at a time, start with non-production, and make sure the old tool stops managing a resource before the new one takes over.
DevOps & Platforms
Talk to a cloud engineer
Tell us where you're stuck and we'll come back with practical next steps.
Get in touchSources
- AWS: Disaster recovery options in the cloud
- HashiCorp: HashiCorp adopts Business Source License
- OpenTofu: Open-source infrastructure as code
- IBM Newsroom: IBM Completes Acquisition of HashiCorp
- Microsoft Learn: What is Bicep?
- AWS: What is CloudFormation?
- HashiCorp Developer: Terraform state
- HashiCorp Developer: Manage resource drift
- AWS: CloudFormation drift detection