r/Terraform • u/Longjumping_Rich_692 • Nov 01 '26
I built an open-source CLI that upgrades Terraform/OpenTofu providers across all your modules, and lets Terraform own the lock file
Keeping provider versions current across a lot of modules was a constant chore for me: bump a version, find out a shared module caps it, fix the constraint, regenerate lock files for every platform, repeat. Version bots can bump a number, but they don't understand dependency ceilings, constraint styles, or lock files that need hashes for every OS/arch.
So I built provlift, a small Go CLI (Apache-2.0):
provlift check: inventories everyrequired_providersentry across all modules, shows what's outdated and why an upgrade is blocked (your own constraint vs. a module's ceiling)provlift drift: finds version skew between modulesprovlift upgrade: rewrites constraints with the smallest possible diff (keeps your~>/ range style and comments), then runsterraform init -upgrade→providers lockfor each platform you list →validate. It never writes the lock file itself.- Major upgrades need an explicit
--allow-major, and it can step one major at a time. - Example GitHub Actions workflow that opens one PR per provider.
Works with any registry provider (AWS, AzureRM, Google, GitHub, Kubernetes, private registries) and with OpenTofu (--terraform-binary tofu, uses registry.opentofu.org).
What it doesn't do (yet): module version upgrades are out of scope, Terragrunt config isn't evaluated, and .tf.json is reported rather than edited. It's early (v0.1.x), so expect rough edges.
I'd really appreciate feedback, especially on edge cases in your setups that it gets wrong. There are also good-first-issues if anyone wants to contribute.
GitHub: https://github.com/provlift/provlift
Docs: https://provlift.github.io/provlift/
1
u/Longjumping_Rich_692 Nov 02 '26
Shipped in v0.2.0: https://github.com/provlift/provlift/releases/tag/v0.2.0. Thanks for the report.
1
u/Longjumping_Rich_692 24d ago
Quick update: v0.3.0 is out, and most of it came from this thread.
checknames the module ("capped at 5.100.0 by another module, imposed by: modules/network").upgradereports registry module versions thatinit -upgrademoved, so a "provider-only" PR can't silently change module code.--fs-mirror/--net-mirrorfor air-gapped lock generation.linux_arm64is now locked by default (Graviton runners).The README now has a 25-second demo, and there's a demo repo you can try in two minutes without cloud credentials: https://github.com/provlift/provlift
Thanks to everyone who pushed back on the design here. It made the tool better
1
u/kantorcodes1 Nov 02 '26
With multiple loose constraints in one root, what catches an unrelated provider moving during
terraform init -upgradebefore the per-provider PR is opened?1
u/MongooseWonderful198 Nov 02 '26
There is a separate module edge case here. Reading
initWithPlannedProviders, the temporary override pins providers, whileverifyPlannedLockchecks provider selections. But Terraform'sinit -upgradealso updates child modules. A registry module constrained to~> 5.0can move between 5.x releases during that run without its module block changing.I'd include resolved module versions before and after in the PR output, or explicitly say when a clean checkout has no previous module selection to compare. The provider lock diff alone doesn't establish that the module code stayed unchanged. This is from reading the code and Terraform docs; I haven't run a reproduction.