OpenTofu 1.9.0 Released

Malcolm Matalka

On this page
OpenTofu 1.9.0 Released
for_each
in provider configuration blocks
OpenTofu 1.9.0 is out, and there’s a lot to like in this new release, but the standout change is the ability to use for_each
inside provider configuration blocks. If you’ve ever had to manage multiple regions or duplicate configurations, this should simplify things substantially. Rather than writing multiple provider blocks for each region, you can let OpenTofu handle that dynamically through a single provider definition. It’s a cleaner way to spin up your resources in different locations without the usual copy-paste overhead.
-exclude
Another addition worth noting is the new -exclude
planning option. It works as the inverse of -target
: instead of specifying what you want to include, you can specify which resources (and their dependencies) you’d like to skip. This is useful when you only want to handle a subset of your infrastructure without touching everything else in your configuration.
Changelog
From performance boosts to bug fixes, there are other updates in 1.9.0 as well, including a note that using the ghcr.io/opentofu/opentofu
container image as a base is deprecated and will be removed in 1.10. If you want the details, check the official changelog for more on what’s changed under the hood. In the meantime, consider upgrading to 1.9.0, especially if you want to take advantage of for_each
in your provider configs or try out the flexibility of the -exclude
option. It should streamline multi-region setups and give you more control over how you manage your plans.