This version includes provider-defined functions and significant improvements from the alpha version.
As with the alpha version, we did everything we could to test this version and would like to ask for the help of the community to help us test this version on non-production workloads. Grab your copy on GitHub and let us know what you think using a GitHub issue.
Do not test this release on a production project! It is not a stable release!
Downloading the beta release
The beta release is available exclusively from the GitHub Releases page. Please select the appropriate file for your platform. Here are some quick links:
Platform/Device | Download link |
---|---|
Desktop Windows computer (64-bit) | tofu_1.7.0-beta1_windows_amd64.zip |
MacOS (Macbook M1 or higher; ARM64) | tofu_1.7.0-beta1_darwin_arm64.tar.gz |
MacOS (Macbook pre-M1 or lower; AMD64) | tofu_1.7.0-beta1_darwin_amd64.tar.gz |
Intel/AMD Linux computer or server (AMD64) | tofu_1.7.0-beta1_linux_amd64.tar.gz |
ARM-based Linux computer or Raspberry Pi 3 or higher (ARM64) | tofu_1.7.0-beta1_linux_arm64.tar.gz |
For the releases above, please unpack the archive and you should find the tofu
binary inside. You can also use the standalone installer to download the release with signature verification.
Provider-defined functions
The new Terraform Plugin SDK added support for provider-defined functions that you can use directly in OpenTofu. This is a significant improvement over using data sources as provider-defined functions don't increase the size of your state file and require less code to write.
If you want to test provider-defined functions, you can use the corefunc provider by Ryan Parman:
If you are interested in a detailed breakdown of this functionality and some of the new unique features OpenTofu brings in this area, join our live stream on April 24.
Loopable import blocks
We made several improvements to the declarative import blocks, most prominently you can now use the for_each
instruction on the block. We have prepared a full documentation for this feature.
In previous OpenTofu versions, you could already use the import
block to declaratively import resources, for example:
In this new version you can now also declaratively import resources in a loop:
The example above will let you specify some random IDs from a variable, and let others be automatically generated.
State encryption
State encryption is one of the flagship features of this release. We have prepared a full documentation for this feature. Since the alpha release we overhauled the migration process from unencrypted to encrypted state files and the rollback mechanism to make the syntax more explicit.
Before you test this feature, please make a backup of your state file. You can then add the following block to enable state encryption:
You can migrate back using the following syntax:
If you have access to an AWS, GCP account, or an OpenBao/MPL-licensed HashiCorp Vault installation, you can also test these key providers.
Removed block
The removed block lets you remove a resource from the state file but keep it on the infrastructure. We have prepared a full documentation for this feature. You can test it by creating a resource first:
After applying, you can replace the resource with a removed block:
After the next apply, you will see that the local_file.test
resource no longer exists in your state file, but the test.txt
file should still exist on your disk. You can now remove the removed block safely.
Built-in function changes
This release also contains several new functions and changes to existing functions:
- New function: templatestring
- New function: base64gunzip
- New function: cidrcontains
- New function: urldecode
- New function: issensitive
- nonsensitive no longer returns an error when the applied values are not sensitive.
- templatefile now supports recursion up to a depth of 1024.
CLI changes
There are also several changes to the CLI:
tofu init
now supports the-json
flag for JSON output.tofu plan
now has a-concise
flag to shorten the plan output.tofu console
now works on Solaris and AIX.- The CLI now supports the XDG directory specification.
- Aliases for:
state list
→state ls
state mv
→state move
state rm
→state remove
Testing feature changes
- Tofu now reads the
.tfvars
file from the tests folder.
Providing feedback
Thank you for taking the time to test this preview release. If you have any feedback, please use a GitHub issue or chat with us on the OpenTofu Slack.