OpenTofu is the community fork of Terraform; Terragrunt is the orchestration layer around it. Together they give an infrastructure codebase two properties a long-lived cloud foundation needs: a license that cannot be changed underneath you, and a dependency graph explicit enough that an entire new environment can be planned before a single resource exists.
Those are the two reasons, and neither is fashion. The rest of this post is the evidence, the migration path, and the cases where a different tool is the better engineering decision.
Why the license question comes up at all
#Terraform was MPL 2.0 from 2014 until August 2023, when HashiCorp relicensed it under the Business Source License 1.1. BUSL is source-available: you can read the code and use it, and you cannot use it to offer a competing product. IBM completed its acquisition of HashiCorp in February 2025.
For almost every enterprise, none of that is a legal problem. You run the tool internally, the additional use grant covers you, and your counsel will say so in a paragraph. The problem is a different one, and it is a governance problem rather than a legal one: the terms under which your build works can be changed by an organization that is not you, at a moment you do not choose. A cloud foundation is a ten-year artifact. The thing that renders it should not need re-evaluating every time a vendor changes owner.
OpenTofu is the fork made in answer to that. It is MPL 2.0, it is hosted by the Linux Foundation, it has a public RFC process, and its contributors come from several companies rather than one. The license answer is therefore short: the code you already have is permanently MPL, and nobody can relicense the project without forking it, at which point you keep what you have. Since the fork the two tools have also diverged on features — OpenTofu added client-side state encryption, early variable evaluation and provider for_each — so “drop-in replacement” describes your existing code rather than the two projects’ futures.
What does Terragrunt actually add?
#Terragrunt is not a language. It is a thin wrapper that does four things, and every one of them is a response to repetition.
- One root configuration, generated everywhere. Backend settings, provider blocks, the role to assume, default tags and version constraints are written once and generated into each unit at run time. Change the tagging policy in one file and every unit in the repository picks it up.
- A unit is a state boundary. One directory, one configuration, one state key. This is the single most consequential structural decision in the repository, and it deserves its own post — Terraform state at enterprise scale is that post.
- Declared dependencies with typed outputs. A unit says which other units it needs and reads their outputs by name. Nobody copies a VPC ID into a variable file.
- Orchestration across the graph. One command plans or applies many units in dependency order, which is what makes a fifteen-account apply a pipeline step rather than a runbook with a checklist.
Stacks are the newer piece and the one that scales. A stack file declares a set of units from a template plus the values that differ, so “a workload account” exists once as a definition rather than four times as a copy. In the AWS Enterprise Baseline, 22 stack files and 52 unit definitions generate 88 units across 15 accounts from 38 modules. Adding a fifth workload account is a map entry and a folder: two pull requests, no new architecture.
That ratio is the argument. If your environment has no ratio like it — if you have one environment and one account — Terragrunt is overhead, and the honest recommendation is further down this page.
How can a new environment plan before it exists?
#Here is the problem every multi-unit codebase hits. Unit B needs the VPC ID that unit A produces. Unit A has not been applied. So B cannot plan, and you find out whether B was written correctly only after A is real. Teams accept this and apply in waves, discovering a typo in wave four with three waves of resources already created.
A dependency block can carry mock outputs: placeholder values for the outputs of a unit that does not exist yet, used only when the real outputs are unavailable, and configured to apply to plan and validate but never to apply. With complete mocks, the whole environment plans from nothing.
The catch is that mocks rot. Someone adds an output to a module, does not add it to the mock, and plan-before-apply quietly stops working for that unit — which nobody notices until the next environment build, because everything else still plans fine against real state.
So the mock completeness becomes a test. In the AWS Enterprise Baseline, one of eight guard scripts running on every pull request checks that dependency mock outputs are complete — every attribute the unit actually reads, not merely a block that exists, because a partial mock is no better than none. The other five reject hardcoded CIDR blocks (addresses come from the IPAM address map, not from a variable someone typed), verify the address map itself, verify the stack layout the generator expects, verify that module versions are pinned, and verify that required inputs are present. Every one of them was written after its convention broke once, which is the only honest way these lists ever get made. Guard scripts are cheap and they catch the class of mistake that code review is worst at: the thing that is absent. There is more on that pattern in the golden path for new services.
Two details make mocks safe rather than merely convenient. They are restricted to validate and plan, so a mock value can never reach the cloud. And they are written as obvious sentinels — account identifiers made of zeros, resource identifiers containing the word mock, addresses from a reserved range — so that if one ever did surface in a real plan, nobody would mistake it for a fact.
How do you migrate from Terraform?
#Three steps. Each is independently valuable and none of them forces the next.
| Step | What you do | What to watch | How you know it worked |
|---|---|---|---|
| 1. Swap the binary | Initialize with OpenTofu against the same state and backend | Version-pin the binary in CI and locally; check any provider or language feature added after the fork | tofu plan returns no changes on an unchanged codebase |
| 2. Wrap the modules | Keep root modules as they are; add one Terragrunt configuration per environment that generates backend and provider blocks and declares dependencies | State keys do not have to move, and moving them is a separate change with its own risk | The same empty plan, now produced through Terragrunt |
| 3. Adopt stacks | Replace copied environment folders with a stack file plus values | Only worth doing where you have several of something | Adding an environment is a map entry, not a copy |
Step one is usually an afternoon. The thing to be rigid about: if the plan after the swap is not empty, stop. A non-empty plan means something interpreted your configuration differently, and the safe move is to understand it rather than to let an apply reconcile it. That is the same discipline described in drift is a fact, not a failure — a difference is information, and the response to information is not to apply.
Step two is where most of the work is, and it is the step that pays. Step three is optional, and a team that stops at step two has a perfectly respectable codebase.
One principle covers the harder migrations — from CloudFormation, from a console-built account, from an existing organization built with another tool. At no point may two tools manage the same resource. Adoption is done with import blocks, which sit in the code next to the resource they claim, so taking ownership of an existing organization is a reviewed diff with a plan attached rather than a command someone ran. Where a thing already exists and cannot be duplicated — an organization, for instance — importing it is the only correct move, and a tool that offers to create a second one is telling you the code is wrong.
When is plain Terraform or CDK the better choice?
#Recommending this toolchain for everything would be dishonest. It is a fit for repetition, multiple accounts and a long horizon. Outside that, other choices win.
| Your situation | The better choice | Why |
|---|---|---|
| One team, one account, a few dozen resources | Plain OpenTofu or Terraform, no wrapper | Terragrunt’s value is entirely in removing repetition. With no repetition it is a layer to learn and debug for nothing |
| The people writing infrastructure are application developers who will not write HCL | AWS CDK or Pulumi | Types, loops, abstraction and unit tests in a language the team already knows. The constraint to accept with CDK is CloudFormation underneath it: resource coverage, stack limits, and whole-stack rollback on a failed update |
| Your organization already runs HCP Terraform with policy-as-code and a team that operates it | Terraform on HCP | You have already paid the integration cost. Switching buys a license property you may not need enough to justify the churn |
| A single application, deployed to one cloud, with a platform the vendor manages | The platform’s own tooling | If you never wanted to own the infrastructure layer, adopting a foundation toolchain is the wrong shape of answer |
| Ten or more accounts, several regions, repeated environments, a ten-year horizon | OpenTofu with Terragrunt | This is the ratio the toolchain exists for, and the license property matters most on the longest timescale |
The same honesty applies to the alternatives to building any of it. AWS Control Tower with Account Factory for Terraform, the Landing Zone Accelerator, Cloud Posse’s reference architectures and Gruntwork’s IaC library all solve overlapping problems, and for a team that wants to assemble and operate the pieces themselves, they are real options with real communities.
What it looks like in a delivered foundation
#The AWS Enterprise Baseline is written in OpenTofu and Terragrunt, using Terragrunt Stacks, and pinned: OpenTofu 1.12.6, Terragrunt 1.1.6, AWS provider ~> 6.65, with every GitHub Action pinned by commit SHA. It is 38 modules, 52 unit definitions and 22 stack files generating 88 units across 15 accounts in 2 organizational units, with 3 workflows and 8 guard scripts.
Two conventions in that code matter more than any module. Every value specific to a deployment is tagged TODO: and every optional choice is tagged @optional:, with the price of the paid ones written in the comment beside the switch. You can read the repository and find every decision that was made for you, which is the opposite of a foundation whose defaults are discovered during an incident.
The pipeline is the ordinary one and it is the point: a pull request produces a plan posted as a comment, review happens on the plan, merge triggers an apply across the accounts in dependency order, and production is gated by an environment with required reviewers. Nothing is applied from a laptop. If that sounds like a lot of ceremony, it is roughly the same ceremony as a code review, and it is the difference described in if deployment requires a hero, it isn’t automated.
The code is delivered into your repositories and your accounts, source-available under the PolyForm Internal Use License 1.0.0, built on open-source tooling. What the BuiltForProd Baseline adds on top of the tools is the decisions: which units exist, what depends on what, and which switches are on.
Where to start this week
#- Run the binary swap in a scratch branch. Initialize with OpenTofu against a copy of a non-production state and confirm an empty plan. You now know the size of the decision instead of debating it.
- Count your copies. How many directories differ only by an environment name? That number is what Terragrunt would remove, and if it is one, do not adopt it.
- Try to plan an environment that does not exist. If you cannot, you have found the reason deployments feel like discovery.
- Write one guard script. The cheapest is “no hardcoded CIDR blocks”. It takes an hour and it will find something.
If you would rather have the structure already decided and the guards already written, the BuiltForProd Blueprints sit on top of exactly this toolchain, and the BuiltForProd Assessment measures what you have today against the BuiltForProd Standard before anyone proposes changing it.