<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
        <title>OpenTofu Blog</title>
        <link>https://opentofu.org/blog</link>
        <description>OpenTofu Blog</description>
        <lastBuildDate>Tue, 07 Apr 2026 00:00:00 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <language>en</language>
        <item>
            <title><![CDATA[OpenTofu 1.12.0-beta1 is now available]]></title>
            <link>https://opentofu.org/blog/help-us-test-opentofu-1-12-0-beta1</link>
            <guid>https://opentofu.org/blog/help-us-test-opentofu-1-12-0-beta1</guid>
            <pubDate>Tue, 07 Apr 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[We've now published the first beta release of OpenTofu 1.12.0. For this cycle we intentionally worked mainly on smaller enhancements and fixes, since it's otherwise easy for those to get left behind when we prioritize larger features. Nonetheless, there are some commonly-requested improvements here that we hope you'll enjoy.]]></description>
            <content:encoded><![CDATA[<p>We've now published the first beta release of OpenTofu 1.12.0. For this cycle we intentionally worked mainly on smaller enhancements and fixes, since it's otherwise easy for those to get left behind when we prioritize larger features. Nonetheless, there are some commonly-requested improvements here that we hope you'll enjoy.</p>
<div class="flex flex-col py-2 px-3 not-prose border gap-1 [&amp;+&amp;]:mt-3 [&amp;_a:hover]:text-gray-900 dark:[&amp;_a:hover]:text-gray-50 [&amp;_a>code]:font-bold [&amp;_code]:text-base [&amp;_code]:px-1.5 [&amp;_a]:underline [&amp;_p]:mb-2 bg-yellow-100 border-yellow-500 text-yellow-800 dark:bg-yellow-950 dark:border-yellow-700 dark:text-yellow-100" role="alert"><div class="flex gap-3 font-bold"><span class="flex w-4 fill-current [&amp;>svg]:w-full" aria-hidden="true"><svg viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"></path></svg></span>Warning</div><div class="leading-relaxed"><p>Do not use OpenTofu prereleases in production environments!</p></div></div>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="download-and-installation">Download and Installation<a href="https://opentofu.org/blog/help-us-test-opentofu-1-12-0-beta1#download-and-installation" class="hash-link" aria-label="Direct link to Download and Installation" title="Direct link to Download and Installation">​</a></h2>
<p>Download the appropriate package for your platform:</p>
<table><thead><tr><th>Platform</th><th>Release Package</th></tr></thead><tbody><tr><td>macOS (Apple Silicon)</td><td><a href="https://github.com/opentofu/opentofu/releases/download/v1.12.0-beta1/tofu_1.12.0-beta1_darwin_arm64.zip" target="_blank" rel="noopener noreferrer">tofu_1.12.0-beta1_darwin_arm64.zip</a></td></tr><tr><td>Linux (AMD64)</td><td><a href="https://github.com/opentofu/opentofu/releases/download/v1.12.0-beta1/tofu_1.12.0-beta1_linux_amd64.zip" target="_blank" rel="noopener noreferrer">tofu_1.12.0-beta1_linux_amd64.zip</a></td></tr><tr><td>Linux (ARM64)</td><td><a href="https://github.com/opentofu/opentofu/releases/download/v1.12.0-beta1/tofu_1.12.0-beta1_linux_arm64.zip" target="_blank" rel="noopener noreferrer">tofu_1.12.0-beta1_linux_arm64.zip</a></td></tr><tr><td>Windows (AMD64)</td><td><a href="https://github.com/opentofu/opentofu/releases/download/v1.12.0-beta1/tofu_1.12.0-beta1_windows_amd64.zip" target="_blank" rel="noopener noreferrer">tofu_1.12.0-beta1_windows_amd64.zip</a></td></tr></tbody></table>
<p>We also provide packages for some other platforms on a best-effort basis. For more information, refer to <a href="https://github.com/opentofu/opentofu/releases/tag/v1.12.0-beta1" target="_blank" rel="noopener noreferrer">the full set of release packages</a>.</p>
<p>After downloading, extract the archive to find the <code>tofu</code> executable.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="whats-new-in-opentofu-112">What's New in OpenTofu 1.12<a href="https://opentofu.org/blog/help-us-test-opentofu-1-12-0-beta1#whats-new-in-opentofu-112" class="hash-link" aria-label="Direct link to What's New in OpenTofu 1.12" title="Direct link to What's New in OpenTofu 1.12">​</a></h2>
<p>The following sections describe some highlights of this release. For the full set of changes in this release, refer to <a href="https://github.com/opentofu/opentofu/blob/v1.12/CHANGELOG.md" target="_blank" rel="noopener noreferrer">the OpenTofu v1.12 changelog</a>.</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="prevent_destroy-can-now-be-set-dynamically"><code>prevent_destroy</code> can now be set dynamically<a href="https://opentofu.org/blog/help-us-test-opentofu-1-12-0-beta1#prevent_destroy-can-now-be-set-dynamically" class="hash-link" aria-label="Direct link to prevent_destroy-can-now-be-set-dynamically" title="Direct link to prevent_destroy-can-now-be-set-dynamically">​</a></h3>
<p>The <code>prevent_destroy</code> argument for managed resources can now refer to input variables and other dynamic symbols, so for example you can write a module that refuses deletion of an important object by default but allow the caller to override that in development environments:</p>
<div class="language-hcl codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-hcl codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token keyword" style="color:hsl(286, 60%, 67%)">variable</span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)"> "prevent_destroy_database" </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">type</span><span class="token plain">    </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> bool</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">default</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token boolean" style="color:hsl(29, 54%, 61%)">true</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token keyword" style="color:hsl(286, 60%, 67%)">resource </span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)">"example_database"</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"example"</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token comment" style="color:hsl(220, 10%, 40%)"># ...</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token keyword" style="color:hsl(286, 60%, 67%)">lifecycle</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">prevent_destroy</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> var.prevent_destroy_database</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><br></span></code></pre></figure></div></div>
<p>A caller of the above module could explicitly set <code>prevent_destroy_database = false</code> to allow <code>tofu destroy</code> to work, but this would still cause an error by default to reduce the risk of mistakes.</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="import-using-resource-identity">Import using "Resource Identity"<a href="https://opentofu.org/blog/help-us-test-opentofu-1-12-0-beta1#import-using-resource-identity" class="hash-link" aria-label="Direct link to Import using &quot;Resource Identity&quot;" title="Direct link to Import using &quot;Resource Identity&quot;">​</a></h3>
<p>The latest versions of the provider plugin protocol introduce a new concept called "resource identity", which allows each resource type to have a schema for just a small amount of metadata that uniquely identifies an object in the remote system, as opposed to the main state data that includes all of the attributes you can normally interact with in OpenTofu modules.</p>
<p>OpenTofu v1.12 introduces our first major use of that new feature: <em>import</em> using resource identity. Traditionally the <code>tofu import</code> command and <code>import</code> blocks required identifying the object to import with just a single string assigned to the <code>id</code> argument, which is okay for simple cases where the remote object <em>has</em> a single string as its unique identifier but is challenging for resource types where the identifier is some sort of compound key, where previously each resource type needed its own special syntax for how to identify a remote object.</p>
<p><code>import</code> blocks now support a new <code>identity</code> argument which module authors would use instead of <code>id</code> argument to describe what to import using an object that matches the resource type's resource identity schema.</p>
<p>For example, <code>aws_ssm_maintenance_window_target</code> from the <code>hashicorp/aws</code> provider has a resource identity schema that requires both <code>id</code> and <code>window_id</code> attributes to be specified, and so now you can write an <code>import</code> block like this:</p>
<div class="language-hcl codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-hcl codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token keyword" style="color:hsl(286, 60%, 67%)">import</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">to</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> aws_ssm_maintenence_window_target.example</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">identity</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">window_id</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"mw-EXAMPLE"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">id</span><span class="token plain">        </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"20591c06-c386-41ac-928c-5cc32dd43cd9"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><br></span></code></pre></figure></div></div>
<p>For the simpler resource types whose import id format was previously just a simple identifier, their identity schema usually just includes a single required attribute whose name describes what kind of identifier is required. For example, in the <code>hashicorp/aws</code> provider it's common to use an <code>arn</code> attribute whose value is the fully-qualified <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference-arns.html" target="_blank" rel="noopener noreferrer">ARN</a> for the object.</p>
<p>A provider decides what schema to use for each of its resource types. To find out whether a resource type has been updated to support import by resource identity, and which attributes to use if so, refer to the documentation for the resource type you are interested in using the OpenTofu Registry. Most resource types continue to support the original style of import with just a single <code>id</code> string too, but that is technically optional and so over time providers may stop offering that for new resource types.</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="provider-installation-improvements">Provider Installation Improvements<a href="https://opentofu.org/blog/help-us-test-opentofu-1-12-0-beta1#provider-installation-improvements" class="hash-link" aria-label="Direct link to Provider Installation Improvements" title="Direct link to Provider Installation Improvements">​</a></h3>
<p>OpenTofu Registry now returns a full set of checksums when you install a provider, so that the dependency lock file will immediately have enough information to verify packages on all of the platforms the provider supports.</p>
<p>Although previous versions of OpenTofu were able to produce a working dependency lock file when using the default provider installation settings, many of the available customizations of the installation process caused problems related to checksums:</p>
<ul>
<li>
<p>The checksums returned by the registry could not be used to verify packages in <a href="https://opentofu.org/docs/cli/config/config-file/#provider-plugin-cache" target="_blank" rel="noopener noreferrer">the optional global cache directory</a>, so that cache was often ineffective at preventing OpenTofu from redownloading packages from the origin registry.</p>
</li>
<li>
<p>The checksums returned by the registry could also not verify packages from <a href="https://opentofu.org/docs/cli/config/config-file/#implied-local-mirror-directories" target="_blank" rel="noopener noreferrer">local filesystem mirror directories</a> or other <a href="https://opentofu.org/docs/cli/config/config-file/#explicit-installation-method-configuration" target="_blank" rel="noopener noreferrer">alternative installation methods</a>, which caused <code>tofu init</code> to fail when run on a platform other than the one that initially populated the lock file, unless teams remembered to explicitly run <code>tofu providers lock</code> to force adding additional checksums to the lock file.</p>
</li>
<li>
<p>Even with the default settings, running <code>tofu init</code> on a different platform than where it was initially run would cause an additional checksum to be added to the lock file, which is confusing for anyone reviewing changes to the configuration and is particularly problematic for those who use <code>tofu init -lockfile=readonly</code> in their pipeline to ensure that only previously-reviewed providers can be selected.</p>
</li>
</ul>
<p>To avoid these problems, the registry now returns checksums that are suitable for verifying both local and remote provider packages, and <code>tofu init</code> will add them all to the dependency lock file immediately if the downloaded package matches the reported checksums for the current platform.</p>
<p>In particular, most teams should no longer need to use <code>tofu providers lock</code> at all. We've retained it only for its originally-intended purpose: populating the lock file with correct checksums from the origin registry on a system where <code>tofu init</code> is configured to use an alternative installation source. As long as your CLI configuration allows <code>tofu init</code> to install packages directly from from OpenTofu Registry (which is the default), it will record the full set of checksums automatically.</p>
<p>The first time you run <code>tofu init</code> after upgrading, you are likely to find additional entries were added to the <code>hashes</code> argument in your dependency lock file, all of which should use the <code>h1:</code> prefix. This is the hashing scheme that previous versions of OpenTofu could only calculate locally, but OpenTofu v1.12 can now prepopulate all of these hashes at once on first install, in addition to the <code>zh:</code> hashes that were already included by previous versions of OpenTofu. If you already had a lock file entry for a provider that was populated from the registry by a previous version of OpenTofu then it should already have its full set of <code>zh:</code> checksums and so no new items should be added with that prefix.</p>
<p>Alongside the checksum-related changes, we've also made some performance improvements that should allow <code>tofu init</code> to complete faster for those who are installing many small providers.</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="simultaneous-human-readable-and-machine-readable-command-output">Simultaneous Human-readable and Machine-readable Command Output<a href="https://opentofu.org/blog/help-us-test-opentofu-1-12-0-beta1#simultaneous-human-readable-and-machine-readable-command-output" class="hash-link" aria-label="Direct link to Simultaneous Human-readable and Machine-readable Command Output" title="Direct link to Simultaneous Human-readable and Machine-readable Command Output">​</a></h3>
<p>Various OpenTofu commands allow specifying a <code>-json</code> option on the command line to select machine-readable output in JSON format, instead of the normal human-oriented output. However, in previous versions these two modes were mutually-exclusive: requesting machine-readable output disabled the human-oriented output.</p>
<p>OpenTofu v1.12 introduces the alternative <code>-json-into=FILE</code> option, which leaves the human-oriented output enabled on the "stdout" and "stderr" handles but also writes the machine-readable output to the specified file. We expect this would be useful for those running OpenTofu in pipelines where the human-facing output should appear in the main job output for operators to read, but the pipeline also needs access to some or all of that information for automation purposes. The specified path can either refer to a regular file or to a special object like a named pipe or "FIFO", in case your automation needs to react to streaming events concurrently while OpenTofu is still running.</p>
<p>We've also introduced the <code>-json</code> and <code>-json-into=FILE</code> options to many more commands in this release. For most of these the JSON output is currently just human-oriented messages wrapped up in JSON objects, but we're interested in extending these JSON objects with useful data based on your use-cases. If there's some specific automation or an alternative UI you'd like to build that would benefit from machine-readable information about what OpenTofu is working on, please open a feature request issue on GitHub and we'll consider it for a future release.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="join-the-testing-effort">Join the Testing Effort<a href="https://opentofu.org/blog/help-us-test-opentofu-1-12-0-beta1#join-the-testing-effort" class="hash-link" aria-label="Direct link to Join the Testing Effort" title="Direct link to Join the Testing Effort">​</a></h2>
<p>Your testing and feedback are crucial to ensuring that these new capabilities work correctly across different environments and use cases.</p>
<p>If you have a <strong>non-production</strong> environment where you could test any of the new features or bugfixes then we'd appreciate your help. Even if everything works as you expected, please <a href="https://github.com/orgs/opentofu/discussions/3939" target="_blank" rel="noopener noreferrer">share your testing experiences</a> or join the conversation in <a href="https://opentofu.org/slack/" target="_blank" rel="noopener noreferrer">#opentofu in the CNCF Slack workspace</a>.</p>
<p>Thank you for supporting the OpenTofu project!</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Machine and Human readable command output streams]]></title>
            <link>https://opentofu.org/blog/dual-command-output-streams</link>
            <guid>https://opentofu.org/blog/dual-command-output-streams</guid>
            <pubDate>Thu, 22 Jan 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[With the latest nightly build of OpenTofu, we have included support for producing both the human readable and machine readable outputs simultaneously.]]></description>
            <content:encoded><![CDATA[<p>With the <a href="https://nightlies.opentofu.org/nightlies/" target="_blank" rel="noopener noreferrer">latest nightly build</a> of OpenTofu, we have included support for producing both the human readable and <a href="https://opentofu.org/docs/internals/machine-readable-ui/" target="_blank" rel="noopener noreferrer">machine readable</a> outputs simultaneously.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="background">Background<a href="https://opentofu.org/blog/dual-command-output-streams#background" class="hash-link" aria-label="Direct link to Background" title="Direct link to Background">​</a></h2>
<p>Many of OpenTofu's long running commands support the <code>-json</code> flag.  This flag switches the output mode from human readable colorized logs into a <a href="https://opentofu.org/docs/internals/machine-readable-ui/" target="_blank" rel="noopener noreferrer">documented json format</a>. The main downside of using the <code>-json</code> argument is that it completely disables the human readable output. Existing tooling on top of OpenTofu therefore had two options, both with their own drawbacks.</p>
<p>On one hand, you could attempt to parse the human readable output and work based on that fuzzy parsing. This would allow you to keep the exact output that the user is used to relying on and manipulating it as you see fit. The main downsides being an output that changes between versions and a complex and error prone text parser.</p>
<p>On the other hand, you could work exclusively with the machine readable output. This is a stable and versioned interface that can be relied upon and is easy to parse. The main downside is that users may miss or expect you to re-create portions of the human readable output (a non-trivial task).</p>
<p>With the new <code>-json-into</code> flag, stdout and stderr remain the same output that users have come to expect, while at the same time streaming the machine readable logs into whatever file or pipe you specify.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="examples">Examples<a href="https://opentofu.org/blog/dual-command-output-streams#examples" class="hash-link" aria-label="Direct link to Examples" title="Direct link to Examples">​</a></h2>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="simple-output-capture">Simple output capture<a href="https://opentofu.org/blog/dual-command-output-streams#simple-output-capture" class="hash-link" aria-label="Direct link to Simple output capture" title="Direct link to Simple output capture">​</a></h3>
<p>To start off, let's capture the output from <code>tofu plan</code> using the new flag.  We can then process the output (in this case with jq) to produce our own summary.</p>
<div class="language-bash codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-bash codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">$ tofu plan -json-into</span><span class="token operator" style="color:hsl(207, 82%, 66%)">=</span><span class="token plain">plan.json </span><span class="token parameter variable" style="color:hsl(207, 82%, 66%)">-out</span><span class="token plain"> planfile</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">..</span><span class="token plain">.</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token comment" style="color:hsl(220, 10%, 40%)"># random_password.password[99] will be created</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  + resource </span><span class="token string" style="color:hsl(95, 38%, 62%)">"random_password"</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"password"</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      + bcrypt_hash </span><span class="token operator" style="color:hsl(207, 82%, 66%)">=</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">(</span><span class="token plain">sensitive value</span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      + </span><span class="token function" style="color:hsl(207, 82%, 66%)">id</span><span class="token plain">          </span><span class="token operator" style="color:hsl(207, 82%, 66%)">=</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">(</span><span class="token plain">known after apply</span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      + length      </span><span class="token operator" style="color:hsl(207, 82%, 66%)">=</span><span class="token plain"> </span><span class="token number" style="color:hsl(29, 54%, 61%)">16</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      + lower       </span><span class="token operator" style="color:hsl(207, 82%, 66%)">=</span><span class="token plain"> </span><span class="token boolean" style="color:hsl(29, 54%, 61%)">true</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      + min_lower   </span><span class="token operator" style="color:hsl(207, 82%, 66%)">=</span><span class="token plain"> </span><span class="token number" style="color:hsl(29, 54%, 61%)">0</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      + min_numeric </span><span class="token operator" style="color:hsl(207, 82%, 66%)">=</span><span class="token plain"> </span><span class="token number" style="color:hsl(29, 54%, 61%)">0</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      + min_special </span><span class="token operator" style="color:hsl(207, 82%, 66%)">=</span><span class="token plain"> </span><span class="token number" style="color:hsl(29, 54%, 61%)">0</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      + min_upper   </span><span class="token operator" style="color:hsl(207, 82%, 66%)">=</span><span class="token plain"> </span><span class="token number" style="color:hsl(29, 54%, 61%)">0</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      + number      </span><span class="token operator" style="color:hsl(207, 82%, 66%)">=</span><span class="token plain"> </span><span class="token boolean" style="color:hsl(29, 54%, 61%)">true</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      + numeric     </span><span class="token operator" style="color:hsl(207, 82%, 66%)">=</span><span class="token plain"> </span><span class="token boolean" style="color:hsl(29, 54%, 61%)">true</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      + result      </span><span class="token operator" style="color:hsl(207, 82%, 66%)">=</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">(</span><span class="token plain">sensitive value</span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">)</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      + special     </span><span class="token operator" style="color:hsl(207, 82%, 66%)">=</span><span class="token plain"> </span><span class="token boolean" style="color:hsl(29, 54%, 61%)">true</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      + upper       </span><span class="token operator" style="color:hsl(207, 82%, 66%)">=</span><span class="token plain"> </span><span class="token boolean" style="color:hsl(29, 54%, 61%)">true</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">Plan: </span><span class="token number" style="color:hsl(29, 54%, 61%)">200</span><span class="token plain"> to add, </span><span class="token number" style="color:hsl(29, 54%, 61%)">0</span><span class="token plain"> to change, </span><span class="token number" style="color:hsl(29, 54%, 61%)">0</span><span class="token plain"> to destroy.</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">Saved the plan to: planfile</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">To perform exactly these actions, run the following </span><span class="token builtin class-name" style="color:hsl(29, 54%, 61%)">command</span><span class="token plain"> to apply:</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    tofu apply </span><span class="token string" style="color:hsl(95, 38%, 62%)">"planfile"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">$ </span><span class="token function" style="color:hsl(207, 82%, 66%)">cat</span><span class="token plain"> plan.json  </span><span class="token operator" style="color:hsl(207, 82%, 66%)">|</span><span class="token plain"> jq </span><span class="token parameter variable" style="color:hsl(207, 82%, 66%)">-r</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">'select(.type=="planned_change") | "Planned Change: \(.change.action) \(.change.resource.addr)"'</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">..</span><span class="token plain">.</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">Planned Change: create random_password.password</span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">[</span><span class="token number" style="color:hsl(29, 54%, 61%)">95</span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">Planned Change: create random_password.password</span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">[</span><span class="token number" style="color:hsl(29, 54%, 61%)">96</span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">Planned Change: create random_password.password</span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">[</span><span class="token number" style="color:hsl(29, 54%, 61%)">97</span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">Planned Change: create random_password.password</span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">[</span><span class="token number" style="color:hsl(29, 54%, 61%)">98</span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">Planned Change: create random_password.password</span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">[</span><span class="token number" style="color:hsl(29, 54%, 61%)">99</span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">]</span><br></span></code></pre></figure></div></div>
<p>As you can see, the user still sees the output that they are familiar with, while producing a machine readable artefact which can be further processed.</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="streamed-output-capture">Streamed output capture<a href="https://opentofu.org/blog/dual-command-output-streams#streamed-output-capture" class="hash-link" aria-label="Direct link to Streamed output capture" title="Direct link to Streamed output capture">​</a></h3>
<p>For a slightly more fun example, we can use <a href="https://github.com/magodo/pipeform" target="_blank" rel="noopener noreferrer">pipeform</a> to demonstrate some of the more advanced capabilities that this new flag offers.</p>
<iframe width="560" height="315" src="https://www.youtube.com/embed/wWyGmMN4HHk?si=zmoboVlnqFPY7tT-" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin"></iframe>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="downloading-the-nightly-builds">Downloading the nightly builds<a href="https://opentofu.org/blog/dual-command-output-streams#downloading-the-nightly-builds" class="hash-link" aria-label="Direct link to Downloading the nightly builds" title="Direct link to Downloading the nightly builds">​</a></h2>
<div class="flex flex-col py-2 px-3 not-prose border gap-1 [&amp;+&amp;]:mt-3 [&amp;_a:hover]:text-gray-900 dark:[&amp;_a:hover]:text-gray-50 [&amp;_a>code]:font-bold [&amp;_code]:text-base [&amp;_code]:px-1.5 [&amp;_a]:underline [&amp;_p]:mb-2 bg-yellow-100 border-yellow-500 text-yellow-800 dark:bg-yellow-950 dark:border-yellow-700 dark:text-yellow-100" role="alert"><div class="flex gap-3 font-bold"><span class="flex w-4 fill-current [&amp;>svg]:w-full" aria-hidden="true"><svg viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"></path></svg></span>Warning</div><div class="leading-relaxed"><p>Do not test this release on a production project! It is not a stable release!</p></div></div>
<p>The nightly builds are available exclusively from the <a href="https://nightlies.opentofu.org/nightlies/" target="_blank" rel="noopener noreferrer">OpenTofu Nightly Repository</a>. Please choose the select the appropriate file for your platform.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OpenTofu v1.11.0]]></title>
            <link>https://opentofu.org/blog/opentofu-1-11-0</link>
            <guid>https://opentofu.org/blog/opentofu-1-11-0</guid>
            <pubDate>Tue, 09 Dec 2025 00:00:00 GMT</pubDate>
            <description><![CDATA[OpenTofu 1.11.0 introduces ephemeral values and a new way to conditionally enable resources.]]></description>
            <content:encoded><![CDATA[<p>Today we've released OpenTofu v1.11.0, collecting together several months of work from the OpenTofu community, including some significant new features.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="ephemeral-resources-and-write-only-attributes">Ephemeral resources and write-only attributes<a href="https://opentofu.org/blog/opentofu-1-11-0#ephemeral-resources-and-write-only-attributes" class="hash-link" aria-label="Direct link to Ephemeral resources and write-only attributes" title="Direct link to Ephemeral resources and write-only attributes">​</a></h2>
<p><strong>Ephemeral values</strong> allow OpenTofu to work with data and resources that exist only in memory during a single OpenTofu phase, guaranteeing that those values will not be persisted in state snapshots or plan files:</p>
<ul>
<li>
<p>Use <a href="https://opentofu.org/docs/language/ephemerality/ephemeral-resources/" target="_blank" rel="noopener noreferrer">ephemeral resources</a> to request temporary access to stored credentials or network tunnels for use in provider or provisioner configurations, without the resulting values being saved in OpenTofu plan files or state snapshots.</p>
<p>For example, you could use an ephemeral resource to request time-limited AWS credentials from <a href="https://openbao.org/" target="_blank" rel="noopener noreferrer">OpenBao</a> and provide them to the <code>hashicorp/aws</code> provider, or to open a temporary SSH tunnel so that the <code>cyrilgdn/postgresql</code> provider can access a Postgres server on a remote network.</p>
</li>
<li>
<p>Use <a href="https://opentofu.org/docs/language/ephemerality/write-only-attributes/" target="_blank" rel="noopener noreferrer">write-only attributes</a> to set resource arguments that OpenTofu needs access to only when they are changing, such as the initial administrator password for a database.</p>
<p>For example, you could use an ephemeral resource to generate an SSH keypair and then save the private key in your secret store using a write-only attribute so that OpenTofu itself will not need to retain its own copy of the key material.</p>
</li>
</ul>
<p>For more information on these and other related OpenTofu language features, refer to <a href="https://opentofu.org/docs/language/ephemerality/" target="_blank" rel="noopener noreferrer">Ephemerality</a>.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="enabled-for-resources-and-modules"><code>enabled</code> for resources and modules<a href="https://opentofu.org/blog/opentofu-1-11-0#enabled-for-resources-and-modules" class="hash-link" aria-label="Direct link to enabled-for-resources-and-modules" title="Direct link to enabled-for-resources-and-modules">​</a></h2>
<p>OpenTofu has traditionally allowed a module to dynamically enable or disable a particular module by using <a href="https://opentofu.org/docs/v1.11/language/meta-arguments/count/" target="_blank" rel="noopener noreferrer">the <code>count</code> meta-argument</a> to choose between either zero or one instances of the object.</p>
<p>OpenTofu v1.11.0 introduces the <code>enabled</code> meta-argument, which we hope will make it easier for readers to understand that only zero or one instances of a resource are possible:</p>
<div class="language-hcl codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-hcl codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token keyword" style="color:hsl(286, 60%, 67%)">variable</span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)"> "subnet" </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">type</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> object(</span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">id</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> string</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain">)</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">default</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> null</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token keyword" style="color:hsl(286, 60%, 67%)">variable</span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)"> "enable_cluster" </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">type</span><span class="token plain">    </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> bool</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">default</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token boolean" style="color:hsl(29, 54%, 61%)">false</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token keyword" style="color:hsl(286, 60%, 67%)">resource </span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)">"aws_subnet"</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"example"</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token comment" style="color:hsl(220, 10%, 40%)"># ...</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token keyword" style="color:hsl(286, 60%, 67%)">lifecycle</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">enabled</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> var.subnet </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> null</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token keyword" style="color:hsl(286, 60%, 67%)">resource </span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)">"aws_instance"</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"example"</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token comment" style="color:hsl(220, 10%, 40%)"># ...</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">subnet_id</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> var.subnet !</span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> null ? var.subnet.id : aws_subnet.example.id</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token comment" style="color:hsl(220, 10%, 40%)"># ...</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token keyword" style="color:hsl(286, 60%, 67%)">module</span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)"> "servers" </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">source</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"./app-cluster"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">servers</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token number" style="color:hsl(29, 54%, 61%)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token keyword" style="color:hsl(286, 60%, 67%)">lifecycle</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">enabled</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> var.enable_cluster</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><br></span></code></pre></figure></div></div>
<p>For more information, refer to <a href="https://opentofu.org/docs/language/meta-arguments/enabled/" target="_blank" rel="noopener noreferrer">The <code>enabled</code> meta-argument</a>.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="various-other-improvements">Various other improvements<a href="https://opentofu.org/blog/opentofu-1-11-0#various-other-improvements" class="hash-link" aria-label="Direct link to Various other improvements" title="Direct link to Various other improvements">​</a></h2>
<p>There are numerous other improvements in OpenTofu v1.11. For more information, refer to <a href="https://opentofu.org/docs/intro/whats-new/" target="_blank" rel="noopener noreferrer">What's new in version v1.11</a>, or to <a href="https://github.com/opentofu/opentofu/releases/tag/v1.11.0" target="_blank" rel="noopener noreferrer">the OpenTofu v1.11.0 release notes</a>.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="download-and-install">Download and Install<a href="https://opentofu.org/blog/opentofu-1-11-0#download-and-install" class="hash-link" aria-label="Direct link to Download and Install" title="Direct link to Download and Install">​</a></h2>
<p>You can download OpenTofu v1.11.0 directly from <a href="https://github.com/opentofu/opentofu/releases" target="_blank" rel="noopener noreferrer">our GitHub releases page</a>, install it using your preferred package manager, or use our official Docker images.</p>
<p><strong><a href="https://opentofu.org/docs/intro/install/">View our installation guides</a></strong></p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Help us test OpenTofu 1.11.0-beta1]]></title>
            <link>https://opentofu.org/blog/help-us-test-opentofu-1-11-0-beta1</link>
            <guid>https://opentofu.org/blog/help-us-test-opentofu-1-11-0-beta1</guid>
            <pubDate>Wed, 22 Oct 2025 00:00:00 GMT</pubDate>
            <description><![CDATA[OpenTofu 1.11.0-beta1 is Now Available]]></description>
            <content:encoded><![CDATA[<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="opentofu-1110-beta1-is-now-available">OpenTofu 1.11.0-beta1 is Now Available<a href="https://opentofu.org/blog/help-us-test-opentofu-1-11-0-beta1#opentofu-1110-beta1-is-now-available" class="hash-link" aria-label="Direct link to OpenTofu 1.11.0-beta1 is Now Available" title="Direct link to OpenTofu 1.11.0-beta1 is Now Available">​</a></h2>
<p>We're excited to announce the beta release of OpenTofu 1.11.0! This release brings two highly anticipated features to beta: <strong>Ephemeral Resources</strong> for handling confidential data without persisting it to state, and the <strong>enabled meta-argument</strong> for conditional resource provisioning.</p>
<p>If you've been following along, you may have seen our <a href="https://opentofu.org/blog/ephemeral-ready-for-testing/">announcement about ephemeral support</a> when these features became available in nightly builds. This beta release marks the first official preview of these capabilities, along with stabilized module deprecation features and important performance improvements.</p>
<div class="flex flex-col py-2 px-3 not-prose border gap-1 [&amp;+&amp;]:mt-3 [&amp;_a:hover]:text-gray-900 dark:[&amp;_a:hover]:text-gray-50 [&amp;_a>code]:font-bold [&amp;_code]:text-base [&amp;_code]:px-1.5 [&amp;_a]:underline [&amp;_p]:mb-2 bg-yellow-100 border-yellow-500 text-yellow-800 dark:bg-yellow-950 dark:border-yellow-700 dark:text-yellow-100" role="alert"><div class="flex gap-3 font-bold"><span class="flex w-4 fill-current [&amp;>svg]:w-full" aria-hidden="true"><svg viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"></path></svg></span>Warning</div><div class="leading-relaxed"><p>Do not test this release on production projects! This is not a stable release.</p></div></div>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="download-and-installation">Download and Installation<a href="https://opentofu.org/blog/help-us-test-opentofu-1-11-0-beta1#download-and-installation" class="hash-link" aria-label="Direct link to Download and Installation" title="Direct link to Download and Installation">​</a></h2>
<p>The beta release is available from the <a href="https://github.com/opentofu/opentofu/releases/tag/v1.11.0-beta1" target="_blank" rel="noopener noreferrer">GitHub Releases page</a>. Select the appropriate file for your platform:</p>
<table><thead><tr><th>Platform</th><th>Download link</th></tr></thead><tbody><tr><td>Windows (64-bit)</td><td><a href="https://github.com/opentofu/opentofu/releases/download/v1.11.0-beta1/tofu_1.11.0-beta1_windows_amd64.zip" target="_blank" rel="noopener noreferrer">tofu_1.11.0-beta1_windows_amd64.zip</a></td></tr><tr><td>macOS (Apple Silicon)</td><td><a href="https://github.com/opentofu/opentofu/releases/download/v1.11.0-beta1/tofu_1.11.0-beta1_darwin_arm64.tar.gz" target="_blank" rel="noopener noreferrer">tofu_1.11.0-beta1_darwin_arm64.tar.gz</a></td></tr><tr><td>macOS (Intel)</td><td><a href="https://github.com/opentofu/opentofu/releases/download/v1.11.0-beta1/tofu_1.11.0-beta1_darwin_amd64.tar.gz" target="_blank" rel="noopener noreferrer">tofu_1.11.0-beta1_darwin_amd64.tar.gz</a></td></tr><tr><td>Linux (AMD64)</td><td><a href="https://github.com/opentofu/opentofu/releases/download/v1.11.0-beta1/tofu_1.11.0-beta1_linux_amd64.tar.gz" target="_blank" rel="noopener noreferrer">tofu_1.11.0-beta1_linux_amd64.tar.gz</a></td></tr><tr><td>Linux (ARM64)</td><td><a href="https://github.com/opentofu/opentofu/releases/download/v1.11.0-beta1/tofu_1.11.0-beta1_linux_arm64.tar.gz" target="_blank" rel="noopener noreferrer">tofu_1.11.0-beta1_linux_arm64.tar.gz</a></td></tr></tbody></table>
<p>After downloading, unpack the archive to find your <code>tofu</code> binary. For verified downloads, you can also use the <a href="https://opentofu.org/docs/intro/install/standalone/" target="_blank" rel="noopener noreferrer">standalone installer</a> with signature verification.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="whats-new-in-1110-beta1">What's New in 1.11.0-beta1<a href="https://opentofu.org/blog/help-us-test-opentofu-1-11-0-beta1#whats-new-in-1110-beta1" class="hash-link" aria-label="Direct link to What's New in 1.11.0-beta1" title="Direct link to What's New in 1.11.0-beta1">​</a></h2>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="ephemeral-resources--write-only-attributes---beta-release">Ephemeral Resources / Write-Only Attributes - Beta Release<a href="https://opentofu.org/blog/help-us-test-opentofu-1-11-0-beta1#ephemeral-resources--write-only-attributes---beta-release" class="hash-link" aria-label="Direct link to Ephemeral Resources / Write-Only Attributes - Beta Release" title="Direct link to Ephemeral Resources / Write-Only Attributes - Beta Release">​</a></h3>
<p>Ephemeral resources allow you to work with confidential data, temporary credentials, and transient infrastructure without persisting them to your state.</p>
<p>A long-standing challenge with infrastructure-as-code has been the storage of confidential data within state. This includes passwords, API keys, certificates, and other secrets that could lead to security incidents if leaked. Ephemeral resources solve this problem by ensuring these values only exist during the execution of a single OpenTofu command.</p>
<h4 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="key-benefits">Key Benefits<a href="https://opentofu.org/blog/help-us-test-opentofu-1-11-0-beta1#key-benefits" class="hash-link" aria-label="Direct link to Key Benefits" title="Direct link to Key Benefits">​</a></h4>
<ul>
<li><strong>Enhanced Security</strong>: Confidential values never touch your state files</li>
<li><strong>Transient Resources</strong>: Create temporary network tunnels, SSH proxies, or time-limited credentials</li>
<li><strong>Cleaner State Management</strong>: Reduce the amount of confidential data requiring encryption and protection</li>
</ul>
<h4 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="how-it-works">How It Works<a href="https://opentofu.org/blog/help-us-test-opentofu-1-11-0-beta1#how-it-works" class="hash-link" aria-label="Direct link to How It Works" title="Direct link to How It Works">​</a></h4>
<p>Ephemeral resources are opened at the beginning of an OpenTofu operation, used during execution, and closed when no longer needed. No ephemeral values are ever stored in your state.</p>
<p>Here's a simple example that also uses write-only attributes; These allow you to pass ephemeral data into regular resources without storing that information in your state:</p>
<div class="language-hcl codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-hcl codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token comment" style="color:hsl(220, 10%, 40%)"># Use AWS SecretsManager to generate a random password</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">ephemeral </span><span class="token string" style="color:hsl(95, 38%, 62%)">"aws_secretsmanager_random_password"</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"password"</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token keyword" style="color:hsl(286, 60%, 67%)">resource </span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)">"kubernetes_secret_v1"</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"credentials"</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token keyword" style="color:hsl(286, 60%, 67%)">metadata</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">name</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"admin"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">namespace</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"my-app"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">data_wo</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">username</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"admin"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">password</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> ephemeral.aws_secretsmanager_random_password.password.random_password</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">data_wo_revision</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token number" style="color:hsl(29, 54%, 61%)">1</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">type</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"kubernetes.io/basic-auth"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><br></span></code></pre></figure></div></div>
<p>In this case, we're using the <code>aws_secretsmanager_random_password</code> ephemeral resource to generate a random password and store it in a kubernetes secret.</p>
<p>The value of this password will never be stored in the plan or the state by OpenTofu. Because OpenTofu does not store the value in the state the resource will only update it's password value when the revision number is incremented.</p>
<p>You can find more in our documentation for <a href="https://opentofu.org/docs/v1.11/language/ephemerality/ephemeral-resources/">Ephemerality</a> and <a href="https://opentofu.org/docs/v1.11/language/ephemerality/write-only-attributes/">Write-Only Attributes</a></p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="the-enabled-meta-argument">The <code>enabled</code> Meta-Argument<a href="https://opentofu.org/blog/help-us-test-opentofu-1-11-0-beta1#the-enabled-meta-argument" class="hash-link" aria-label="Direct link to the-enabled-meta-argument" title="Direct link to the-enabled-meta-argument">​</a></h3>
<p>The new <code>enabled</code> meta-argument provides a cleaner alternative to <code>count</code> and <code>for_each</code> for scenarios where you need to conditionally create a single resource or module instance. This addresses one of the most common patterns in infrastructure code: "create this resource only if a certain condition is true."</p>
<h4 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="why-enabled">Why <code>enabled</code>?<a href="https://opentofu.org/blog/help-us-test-opentofu-1-11-0-beta1#why-enabled" class="hash-link" aria-label="Direct link to why-enabled" title="Direct link to why-enabled">​</a></h4>
<p>Previously, you'd use <code>count = var.create_instance ? 1 : 0</code>, which works but has downsides:</p>
<ul>
<li>Creates arrays even for single resources (requiring <code>[0]</code> indexing)</li>
<li>Less readable and intuitive than a simple boolean flag</li>
<li>Can be confusing for module consumers</li>
</ul>
<p>The <code>enabled</code> meta-argument solves this elegantly:</p>
<div class="language-hcl codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-hcl codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token keyword" style="color:hsl(286, 60%, 67%)">resource </span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)">"aws_instance"</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"web"</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">ami</span><span class="token plain">           </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"ami-12345"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">instance_type</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"t3.micro"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token keyword" style="color:hsl(286, 60%, 67%)">lifecycle</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">enabled</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> var.create_instance  </span><span class="token comment" style="color:hsl(220, 10%, 40%)"># Simple boolean condition</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><br></span></code></pre></figure></div></div>
<h4 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="module-example">Module Example<a href="https://opentofu.org/blog/help-us-test-opentofu-1-11-0-beta1#module-example" class="hash-link" aria-label="Direct link to Module Example" title="Direct link to Module Example">​</a></h4>
<p>This is especially useful in modules where you want to make resources optional:</p>
<div class="language-hcl codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-hcl codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token keyword" style="color:hsl(286, 60%, 67%)">variable</span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)"> "create_cluster" </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">type</span><span class="token plain">    </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> bool</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">default</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token boolean" style="color:hsl(29, 54%, 61%)">true</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token keyword" style="color:hsl(286, 60%, 67%)">module</span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)"> "servers" </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">source</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"./app-cluster"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">servers</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token number" style="color:hsl(29, 54%, 61%)">5</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token keyword" style="color:hsl(286, 60%, 67%)">lifecycle</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">enabled</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> var.create_cluster </span><span class="token comment" style="color:hsl(220, 10%, 40%)"># Can make whole modules optional</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><br></span></code></pre></figure></div></div>
<h4 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="nested-in-lifecycle-block">Nested in Lifecycle Block<a href="https://opentofu.org/blog/help-us-test-opentofu-1-11-0-beta1#nested-in-lifecycle-block" class="hash-link" aria-label="Direct link to Nested in Lifecycle Block" title="Direct link to Nested in Lifecycle Block">​</a></h4>
<p>The <code>enabled</code> argument is nested inside the <code>lifecycle</code> block rather than at the resource level. This design choice prevents conflicts with existing input variables or resource arguments that might already be named <code>enabled</code>.</p>
<p>For more information, refer to the enabled meta-argument documentation <a href="https://opentofu.org/docs/v1.11/language/meta-arguments/enabled/">here</a>.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="additional-features-and-improvements">Additional Features and Improvements<a href="https://opentofu.org/blog/help-us-test-opentofu-1-11-0-beta1#additional-features-and-improvements" class="hash-link" aria-label="Direct link to Additional Features and Improvements" title="Direct link to Additional Features and Improvements">​</a></h2>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="module-variable-and-output-deprecation---now-stable">Module Variable and Output Deprecation - Now Stable<a href="https://opentofu.org/blog/help-us-test-opentofu-1-11-0-beta1#module-variable-and-output-deprecation---now-stable" class="hash-link" aria-label="Direct link to Module Variable and Output Deprecation - Now Stable" title="Direct link to Module Variable and Output Deprecation - Now Stable">​</a></h3>
<p>The ability to mark module variables and outputs as deprecated, which was experimental in OpenTofu 1.10, is now stable! Module authors can guide users away from legacy interfaces while maintaining backward compatibility.</p>
<p>Mark variables as deprecated:</p>
<div class="language-hcl codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-hcl codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token keyword" style="color:hsl(286, 60%, 67%)">variable</span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)"> "legacy_input" </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">type</span><span class="token plain">       </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> string</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">default</span><span class="token plain">    </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"default-value"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">deprecated</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"This variable is deprecated. Please use 'new_input' instead. This will be removed in v2.0 of this module."</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><br></span></code></pre></figure></div></div>
<p>Mark outputs as deprecated:</p>
<div class="language-hcl codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-hcl codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token keyword" style="color:hsl(286, 60%, 67%)">output</span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)"> "old_endpoint" </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">value</span><span class="token plain">      </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> aws_instance.main.public_ip</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">deprecated</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"This output is deprecated. Use 'instance_endpoint' instead. This will be removed in v2.0 of this module."</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><br></span></code></pre></figure></div></div>
<p>Users will see clear warnings when using deprecated variables or outputs, helping them prepare for future module updates.</p>
<p>For more information, see <a href="https://opentofu.org/docs/v1.11/language/values/variables/#marking-variable-as-deprecated">marking variable as deprecated</a> and <a href="https://opentofu.org/docs/v1.11/language/values/outputs/#deprecated--marking-output-as-deprecated">marking output as deprecated</a></p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="performance-improvements">Performance Improvements<a href="https://opentofu.org/blog/help-us-test-opentofu-1-11-0-beta1#performance-improvements" class="hash-link" aria-label="Direct link to Performance Improvements" title="Direct link to Performance Improvements">​</a></h3>
<p>This release includes significant performance optimizations for large-scale deployments:</p>
<ul>
<li><strong>Improved RAM and CPU efficiency</strong> for configurations that contain thousands of resource instances</li>
<li>Improved handling of complex dependency graphs</li>
<li>Optimized memory usage during plan and apply operations</li>
</ul>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="enhanced-s3-backend">Enhanced S3 Backend<a href="https://opentofu.org/blog/help-us-test-opentofu-1-11-0-beta1#enhanced-s3-backend" class="hash-link" aria-label="Direct link to Enhanced S3 Backend" title="Direct link to Enhanced S3 Backend">​</a></h3>
<p>The S3 backend now supports <strong>object tagging</strong> your backend, allowing you to add custom tags to your state files for better organization and cost tracking:</p>
<div class="language-hcl codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-hcl codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token keyword" style="color:hsl(286, 60%, 67%)">terraform</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token keyword" style="color:hsl(286, 60%, 67%)">backend</span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)"> "s3" </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">bucket</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"my-terraform-state"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">key</span><span class="token plain">    </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"production/terraform.tfstate"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">region</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"us-east-1"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">state_tags</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      </span><span class="token property" style="color:hsl(355, 65%, 65%)">Environment</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"production"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      </span><span class="token property" style="color:hsl(355, 65%, 65%)">Team</span><span class="token plain">        </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"platform"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">lock_tags</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      </span><span class="token property" style="color:hsl(355, 65%, 65%)">Environment</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"production"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      </span><span class="token property" style="color:hsl(355, 65%, 65%)">Team</span><span class="token plain">        </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"platform"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><br></span></code></pre></figure></div></div>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="feedback-request-experimental-encryption-features">Feedback Request: Experimental Encryption Features<a href="https://opentofu.org/blog/help-us-test-opentofu-1-11-0-beta1#feedback-request-experimental-encryption-features" class="hash-link" aria-label="Direct link to Feedback Request: Experimental Encryption Features" title="Direct link to Feedback Request: Experimental Encryption Features">​</a></h3>
<p>OpenTofu introduced experimental support for external encryption methods and key providers in previous releases. These features allow you to integrate with external key management systems and custom encryption workflows.</p>
<p><strong>We need your feedback!</strong> We're planning to stabilize these features and would love to hear about your experiences:</p>
<ul>
<li>Are the <code>external</code> method and <code>external</code> key_provider meeting your needs?</li>
<li>What use cases are you solving with these features?</li>
<li>What improvements would make them more useful?</li>
<li>Are there any issues or limitations you've encountered?</li>
</ul>
<p>If you're using or considering using state encryption with external key management, please share your feedback through <a href="https://github.com/orgs/opentofu/discussions/3416" target="_blank" rel="noopener noreferrer">this GitHub Discussion</a></p>
<p>Your input will directly influence whether these features move to stable in OpenTofu 1.12 or need more development time.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="compatibility-notes">Compatibility Notes<a href="https://opentofu.org/blog/help-us-test-opentofu-1-11-0-beta1#compatibility-notes" class="hash-link" aria-label="Direct link to Compatibility Notes" title="Direct link to Compatibility Notes">​</a></h2>
<p>Before upgrading, please note these important compatibility points and breaking changes:</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="system-requirements">System Requirements<a href="https://opentofu.org/blog/help-us-test-opentofu-1-11-0-beta1#system-requirements" class="hash-link" aria-label="Direct link to System Requirements" title="Direct link to System Requirements">​</a></h3>
<ul>
<li><strong>macOS</strong>: OpenTofu on macOS now requires <strong>macOS 12 Monterey or later</strong></li>
</ul>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="breaking-changes">Breaking Changes<a href="https://opentofu.org/blog/help-us-test-opentofu-1-11-0-beta1#breaking-changes" class="hash-link" aria-label="Direct link to Breaking Changes" title="Direct link to Breaking Changes">​</a></h3>
<ul>
<li>
<p><strong>Azure Backend (<code>azurerm</code>)</strong>:</p>
<ul>
<li>The <code>endpoint</code> and <code>ARM_ENDPOINT</code> configuration options are no longer supported</li>
<li>The <code>msi_endpoint</code> and <code>ARM_MSI_ENDPOINT</code> options are no longer supported</li>
<li>The <code>environment</code> and <code>metadata_host</code> arguments are now mutually exclusive</li>
</ul>
</li>
<li>
<p><strong>issensitive() Function</strong>: Now correctly returns unknown results when evaluating unknown values. Code that previously relied on the incorrect behavior may need updates.</p>
</li>
<li>
<p><strong>Testing with Mocks</strong>: Mock values generated during testing now strictly adhere to provider schemas. Test configurations with invalid mock values will need to be corrected.</p>
</li>
<li>
<p><strong>S3 Module Installation</strong>: When installing module packages from Amazon S3 buckets using S3 source addresses OpenTofu will use the same credentials as the AWS CLI and SDK.</p>
</li>
<li>
<p><strong>TLS and SSH Security</strong>:</p>
<ul>
<li>SHA-1 signatures are no longer accepted for TLS or SSH connections</li>
<li>SSH certificates must comply with the <code>draft-miller-ssh-cert-03</code> specification</li>
</ul>
</li>
</ul>
<p>For complete details, review the <a href="https://github.com/opentofu/opentofu/blob/v1.11.0-beta1/CHANGELOG.md" target="_blank" rel="noopener noreferrer">full changelog</a>.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="join-the-testing-effort">Join the Testing Effort<a href="https://opentofu.org/blog/help-us-test-opentofu-1-11-0-beta1#join-the-testing-effort" class="hash-link" aria-label="Direct link to Join the Testing Effort" title="Direct link to Join the Testing Effort">​</a></h2>
<p>Your testing and feedback are crucial to ensuring that these new capabilities work flawlessly across different environments and use cases. We're especially interested in feedback on:</p>
<ul>
<li><strong>Ephemeral resources</strong>: Does the security model work for your use cases? Are there providers or scenarios where you'd like to see support?</li>
<li><strong>The <code>enabled</code> meta-argument</strong>: Is this pattern more intuitive than <code>count</code>? Are there edge cases we should consider?</li>
<li><strong>Encryption features</strong>: Are the experimental external encryption features ready for stabilization?</li>
</ul>
<p>If you have a <strong>non-production</strong> environment where you could test any of these capabilities, we'd appreciate your help. Even if everything works perfectly, please share your testing experiences through <a href="https://github.com/orgs/opentofu/discussions/3419" target="_blank" rel="noopener noreferrer">this GitHub Discussion</a> or join the conversation in the <a href="https://opentofu.org/slack/" target="_blank" rel="noopener noreferrer">#opentofu channel in the CNCF slack workspace</a>.</p>
<p>Thank you for your continued support of the OpenTofu project!</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fidelity Investments Shares Its Migration Story from Terraform to OpenTofu]]></title>
            <link>https://opentofu.org/blog/fidelity-investment-migration</link>
            <guid>https://opentofu.org/blog/fidelity-investment-migration</guid>
            <pubDate>Mon, 06 Oct 2025 00:00:00 GMT</pubDate>
            <description><![CDATA[Author: James Humphries, OpenTofu Maintainer and Technical Steering Committee Member]]></description>
            <content:encoded><![CDATA[<p><em>Author: James Humphries, OpenTofu Maintainer and Technical Steering Committee Member</em></p>
<p>One of the most common questions I get — whether on forums, in Slack, or at events — is: “How are large enterprises actually using OpenTofu?” At a recent OpenTofu Day, we had a concrete, candid answer.</p>
<p>David Jackson, VP of Cloud Automation and Tooling at Fidelity Investments, took the stage to share how one of the world’s largest financial services companies navigated a full-scale migration from Terraform to OpenTofu. <a href="https://www.youtube.com/watch?v=2FQQOIEgZmU&amp;list=PLj6h78yzYM2P1WUOx9Ny6Q3JJxiAs1A3M&amp;index=10" target="_blank" rel="noopener noreferrer">The session</a> sparked instant interest for its transparency, practicality, and relevance to real-world teams managing complex infrastructure.</p>
<p>I followed up with David to explore his OpenTofu experience in greater detail. If you're exploring OpenTofu for your organization, I hope you will find this conversation essential reading.</p>
<p><strong>Q: David, let’s start with scale. How big is the footprint of Terraform and OpenTofu at Fidelity today?</strong></p>
<p><strong>A:</strong> It’s big. We’ve got over 2,000 applications using Terraform or OpenTofu, managing more than 50,000 state files and north of four million individual cloud resources. On any given day, we’re seeing upwards of 4,000 state file updates. That kind of volume shapes everything—how we evaluate tools, how we design pipelines, how we think about governance. When we started looking at OpenTofu, we knew we weren’t talking about a few isolated teams. This was going to impact hundreds, if not thousands, of engineers.</p>
<p><strong>Q: What triggered the move from Terraform to OpenTofu?</strong></p>
<p><strong>A:</strong> Fidelity has been doubling down on open source for years, and when the licensing changes around Terraform came through, it prompted a broader conversation internally. We looked at OpenTofu and saw a project that was committed to open governance and community contribution. That was important to us. We don’t just consume open source—we contribute to it. OpenTofu aligns with our values and our platform engineering strategy. We also felt it was a technical drop-in, and that made it viable.</p>
<p><strong>Q: What were the first steps in actually making that shift?</strong></p>
<p><strong>A:</strong> We started with a POC, obviously. You’ve got to prove to yourself that OpenTofu is truly a drop-in. And not just in terms of provisioning a resource or two. We pushed all the way through to production. We picked one of our own internal IaC platform applications and ran the entire pipeline—CI/CD, artifact storage, governance, everything—just as we would for any production deployment. That gave us confidence.</p>
<p><strong>Q: You mentioned during the talk that you didn’t stop at proving it worked—you socialized it internally. Can you say more about that?</strong></p>
<p><strong>A:</strong> Socialization was key. In a company our size, nothing moves without consensus. We talked with the right governance groups—our DevOps council, the platform engineering guild, and other decision-making bodies. We laid out the pros and cons. We were honest. And we asked for input early. That helped build trust. Once we had alignment, we moved into enablement: building support tools, documentation, FAQs, internal support channels. We tested everything again with the lighthouse project and made it available for wider adoption.</p>
<p><strong>Q: How did you go from a few early adopters to 70% adoption before making the CLI switch?</strong></p>
<p><strong>A:</strong> A few things worked really well for us. First, we targeted the biggest users of Terraform—teams with hundreds of state files and thousands of resources. We got them on board early, worked side-by-side on migrations, and once they saw success, that sent a strong signal to the rest of the organization. We also tracked adoption closely and shared that data transparently. It gave people confidence. No one wants to be the first to jump—but once they see momentum, they don’t want to be last either.</p>
<p><strong>Q: Did you run into any real resistance along the way?</strong></p>
<p><strong>A:</strong> Honestly, not much. That surprised us a bit. There were some questions around compatibility and support, of course. But because we had done the homework and proved everything in production early on, we had answers ready. Also, we did an internal branding push. We packaged our tooling under a code name—Bento—and branded the migration effort that way. It gave it an identity and made it easier to talk about in internal forums.</p>
<p><strong>Q: What role did shared infrastructure or tooling play in the migration?</strong></p>
<p><strong>A:</strong> A huge one. We’ve got a centralized catalog of reusable modules—hosted in Backstage—with maturity ratings and usage stats. Teams can see what’s battle-tested. That saves a ton of time and prevents drift. We also have shared CI/CD pipelines that we manage centrally. That meant when we updated those pipelines to use the OpenTofu CLI, every project using them automatically migrated. It’s a force multiplier. We’re really trying to make it easy for teams to do the right thing.</p>
<p><strong>Q: Now that OpenTofu is the default, what’s next?</strong></p>
<p><strong>A:</strong> We’ve flipped the default, yes. All new deployments use OpenTofu unless teams explicitly opt out. That’s allowed us to consolidate usage. Now we’re starting to deprecate the older Terraform versions. We have governance checks in place during deployments, so we can enforce that gradually. Eventually, we’ll have a single-track system using just OpenTofu. That’s cleaner for support and security.</p>
<p><strong>Q: Looking back, what are your top lessons learned?</strong></p>
<p><strong>A:</strong> One, the code itself isn’t the hard part. Changing the CLI in a pipeline is trivial. The complexity lives in the surrounding ecosystem—versioning, CI/CD, governance, artifact management. That’s where you need maturity. Two, if you’ve got shared pipelines and modules, you’re going to have a smoother path. And three, data matters. If you can track adoption and share that data internally, it builds trust and drives momentum. That’s how we got the bulk of the org moved over before the cutover date.</p>
<p><strong>Q: Anything you’d say to orgs still hesitating about OpenTofu?</strong></p>
<p><strong>A:</strong> I’d say don’t overthink it. Do a real POC, push it to prod, and see for yourself. OpenTofu really is a drop-in. But also, don’t just flip the switch. Build support. Talk to people. Make it feel like a team effort. That’s how you get adoption that sticks.</p>
<hr>
<p>At the scale Fidelity operates, migrations like this don’t happen without intention. What stands out most in David’s approach is not just the technical execution, but the trust-building, the clear-eyed assessment of what really matters, and the willingness to go deep with both tooling and teams. For those navigating similar decisions, it’s a reminder that success often comes less from the tooling itself and more from the way it’s introduced, supported, and led.</p>
<p><em>Disclaimer: OpenTofu and Fidelity Investments are separate companies.  Unless otherwise noted, the opinions provided are those of the speakers, not necessarily those of Fidelity Investments or its affiliates.</em></p>]]></content:encoded>
            <category>migration</category>
        </item>
        <item>
            <title><![CDATA[Ephemeral Support in OpenTofu]]></title>
            <link>https://opentofu.org/blog/ephemeral-ready-for-testing</link>
            <guid>https://opentofu.org/blog/ephemeral-ready-for-testing</guid>
            <pubDate>Thu, 11 Sep 2025 00:00:00 GMT</pubDate>
            <description><![CDATA[We are excited to announce the availability of Ephemeral and Write-Only features in the latest nightly builds of OpenTofu!]]></description>
            <content:encoded><![CDATA[<p>We are excited to announce the availability of Ephemeral and Write-Only features in the latest nightly builds of OpenTofu!</p>
<p>This is a <a href="https://github.com/opentofu/opentofu/issues/1996" target="_blank" rel="noopener noreferrer">highly requested feature</a> that we have been hard at work on for a while now. All the necessary components have now been merged and are available in the nightly builds of OpenTofu and will be available in the upcoming 1.11 release.</p>
<div class="flex flex-col py-2 px-3 not-prose border gap-1 [&amp;+&amp;]:mt-3 [&amp;_a:hover]:text-gray-900 dark:[&amp;_a:hover]:text-gray-50 [&amp;_a>code]:font-bold [&amp;_code]:text-base [&amp;_code]:px-1.5 [&amp;_a]:underline [&amp;_p]:mb-2 bg-yellow-100 border-yellow-500 text-yellow-800 dark:bg-yellow-950 dark:border-yellow-700 dark:text-yellow-100" role="alert"><div class="flex gap-3 font-bold"><span class="flex w-4 fill-current [&amp;>svg]:w-full" aria-hidden="true"><svg viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"></path></svg></span>Warning</div><div class="leading-relaxed"><p>Do not test this release on a production project! It is not a stable release!</p></div></div>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="downloading-the-nightly-builds">Downloading the nightly builds<a href="https://opentofu.org/blog/ephemeral-ready-for-testing#downloading-the-nightly-builds" class="hash-link" aria-label="Direct link to Downloading the nightly builds" title="Direct link to Downloading the nightly builds">​</a></h2>
<p>The nightly builds are available exclusively from the <a href="https://nightlies.opentofu.org/nightlies/" target="_blank" rel="noopener noreferrer">OpenTofu Nightly Repository</a>. Please choose the select the appropriate file for your platform.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="ephemeral-overview">Ephemeral Overview<a href="https://opentofu.org/blog/ephemeral-ready-for-testing#ephemeral-overview" class="hash-link" aria-label="Direct link to Ephemeral Overview" title="Direct link to Ephemeral Overview">​</a></h2>
<p>A long-standing issue with OpenTofu and its predecessor has been the storage of sensitive data within the state. Prior to Ephemeral, this data contained everything that OpenTofu knows about the resources it manages. This includes sensitive values, keys, and other secrets that could lead to security incidents if leaked. The introduction of Ephemeral and Write-Only allows for careful configuration to prevent storing this secret data, ensuring that these values only exist within the duration of a single execution of the <code>tofu</code> binary. It also allows for transient resources, such as network tunnels, to be made available during specific portions of the OpenTofu Plan/Apply flow.</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="prior-solutions">Prior Solutions<a href="https://opentofu.org/blog/ephemeral-ready-for-testing#prior-solutions" class="hash-link" aria-label="Direct link to Prior Solutions" title="Direct link to Prior Solutions">​</a></h3>
<p>As many seasoned OpenTofu and Terraform authors know, values and attributes can be marked as <a href="https://opentofu.org/docs/language/functions/sensitive/">Sensitive</a> to prevent them from being displayed in the CLI. This helps prevent accidental exposure of secrets through CI/CD logs and other mechanisms. It still however stores the plain text data in the state.</p>
<p>To remedy this, OpenTofu introduced <a href="https://opentofu.org/docs/language/state/encryption/">State and Plan Encryption</a>. This feature allows you to carefully protect your plan and state data, as well as ensuring that they have not been tampered with in transport. Although the values are still stored within the state and plan, this adds an additional level of security to make it much more difficult for attackers to gain access. It protects the entire state and plan, regardless of how individual resources are configured or marked. Therefore it is still recommended to use state and plan encryption, even after adopting Ephemeral concepts into your workflow.</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="ephemeral-resources">Ephemeral Resources<a href="https://opentofu.org/blog/ephemeral-ready-for-testing#ephemeral-resources" class="hash-link" aria-label="Direct link to Ephemeral Resources" title="Direct link to Ephemeral Resources">​</a></h3>
<p><a href="https://opentofu.org/docs/main/language/ephemerality/ephemeral-resources/">Ephemeral Resources</a> are entities that only exist during the execution of a single command. They are opened at the beginning of an OpenTofu operation to get their ephemeral value and closed at the end of the operation. These resources can represent anything from keys in a Key Management System to a SSH proxy that is established when the resource is opened.</p>
<p>The attributes of Ephemeral Resources are marked as <code>ephemeral</code> and as such can only be used in <a href="https://opentofu.org/docs/main/language/ephemerality/ephemeral-resources/">very specific contexts</a>.</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="write-only-attributes">Write-Only Attributes<a href="https://opentofu.org/blog/ephemeral-ready-for-testing#write-only-attributes" class="hash-link" aria-label="Direct link to Write-Only Attributes" title="Direct link to Write-Only Attributes">​</a></h3>
<p><a href="https://opentofu.org/docs/main/language/ephemerality/write-only-attributes/">Write-Only</a> attributes are a special case that has been added to Managed Resources to allow passing ephemeral data into non-ephemeral resources. These attributes can be set in configuration, but their values will never be stored in state or even available as an attribute to be accessed in other portions of the configuration.</p>
<p>This is geared toward sending ephemeral data, such as passwords and keys, into resources which use and/or manage this data outside of OpenTofu.</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="further-reading">Further Reading<a href="https://opentofu.org/blog/ephemeral-ready-for-testing#further-reading" class="hash-link" aria-label="Direct link to Further Reading" title="Direct link to Further Reading">​</a></h3>
<p>This blog post barely scratches the surface of what is now possible with Ephemeral and Write-Only.  Peruse our latest docs for a more <a href="https://opentofu.org/docs/main/language/ephemerality/">complete overview and in-depth examples</a>!</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="providing-feedback">Providing feedback<a href="https://opentofu.org/blog/ephemeral-ready-for-testing#providing-feedback" class="hash-link" aria-label="Direct link to Providing feedback" title="Direct link to Providing feedback">​</a></h2>
<p>Thank you for taking the time to test this preview release. If you have any feedback, please use <a href="https://github.com/opentofu/opentofu/issues/new/choose" target="_blank" rel="noopener noreferrer">a GitHub issue</a> or chat with us on the <a href="https://opentofu.org/slack/" target="_blank" rel="noopener noreferrer">OpenTofu Slack</a>.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OpenTofu 1.10.0: A Well-Seasoned Release]]></title>
            <link>https://opentofu.org/blog/opentofu-1-10-0</link>
            <guid>https://opentofu.org/blog/opentofu-1-10-0</guid>
            <pubDate>Mon, 23 Jun 2025 00:00:00 GMT</pubDate>
            <description><![CDATA[OpenTofu 1.10.0 brings a rich blend of features and improvements, delivering the most comprehensive update yet to the open-source infrastructure as code tool.]]></description>
            <content:encoded><![CDATA[<p>We're thrilled to announce the release of OpenTofu 1.10.0, our most comprehensive update yet! This release represents months of dedicated work from our community, introducing some fantastic features that will improve how OpenTofu users manage and distribute infrastructure as code.</p>
<p>From OCI registry support that revolutionizes provider and module distribution, to adding support for deprecation attributes that helps module authors gracefully evolve their APIs, OpenTofu 1.10.0 is packed with enhancements that address real-world challenges faced by teams at scale. We're incredibly grateful to everyone who tested our alpha and beta releases, provided feedback, and contributed code – your input has been invaluable in shaping this release.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="the-perfect-10-celebrating-10-million-downloads">The Perfect 10: Celebrating 10 Million Downloads<a href="https://opentofu.org/blog/opentofu-1-10-0#the-perfect-10-celebrating-10-million-downloads" class="hash-link" aria-label="Direct link to The Perfect 10: Celebrating 10 Million Downloads" title="Direct link to The Perfect 10: Celebrating 10 Million Downloads">​</a></h2>
<p>As we release OpenTofu 1.10.0, we're thrilled to announce that we're about to cross an incredible milestone: <strong>10 million downloads</strong> from GitHub releases alone! Currently at 9.8 million downloads, we're on track to hit this landmark within days. This doesn't even include installations from Homebrew, package managers, Docker Hub, or corporate mirrors – the true number is likely already well past 20 million.</p>
<p>Perhaps most impressively, our community's trust is evident in adoption velocity. If we look at the GitHub release downloads, when we released v1.9.1, it overtook v1.9.0 in just <strong>7 days</strong> – the fastest patch adoption we've ever seen. Currently, 63% of the total downloads daily are for the latest v1.9.x series.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="major-features-overview">Major Features Overview<a href="https://opentofu.org/blog/opentofu-1-10-0#major-features-overview" class="hash-link" aria-label="Direct link to Major Features Overview" title="Direct link to Major Features Overview">​</a></h2>
<p>OpenTofu 1.10.0 is packed with powerful new capabilities that address real-world infrastructure challenges. Here are the highlights:</p>
<ul>
<li><strong>OCI Registry Support</strong> - Distribute providers and modules through container registries, perfect for air-gapped environments</li>
<li><strong>Native S3 State Locking</strong> - Simplified state management without requiring DynamoDB</li>
<li><strong>Deprecation Support</strong> - Module authors can now mark variables and outputs as deprecated</li>
<li><strong>Enhanced Planning</strong> - New <code>-target-file</code> and <code>-exclude-file</code> options for better resource management</li>
<li><strong>Global Provider Cache Lock</strong> - Safe concurrent operations in CI/CD environments</li>
<li><strong>OpenTelemetry Tracing</strong> - Local-only observability for debugging and performance analysis</li>
<li><strong>External Key Providers</strong> - Flexible state encryption with your preferred secret management tools</li>
<li><strong>Enhanced moved and removed blocks</strong> - More powerful infrastructure refactoring capabilities</li>
</ul>
<p>You can find detailed information about all these features and more on our comprehensive <a href="https://opentofu.org/docs/intro/whats-new/">What's new in OpenTofu 1.10?</a> page.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="ecosystem-maturity">Ecosystem Maturity<a href="https://opentofu.org/blog/opentofu-1-10-0#ecosystem-maturity" class="hash-link" aria-label="Direct link to Ecosystem Maturity" title="Direct link to Ecosystem Maturity">​</a></h2>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="official-vs-code-extension">Official VS Code Extension<a href="https://opentofu.org/blog/opentofu-1-10-0#official-vs-code-extension" class="hash-link" aria-label="Direct link to Official VS Code Extension" title="Direct link to Official VS Code Extension">​</a></h3>
<p>The OpenTofu ecosystem continues to flourish with professional tooling. Our official VS Code extension (currently in preview) provides a first-class development experience with syntax highlighting, IntelliSense autocompletion, real-time validation, and integrated documentation. Whether you're writing modules or managing complex infrastructure, the extension helps catch errors early and speeds up development with smart suggestions for resources, data sources, and built-in functions.</p>
<p>Available on <a href="https://marketplace.visualstudio.com/items?itemName=OpenTofu.vscode-opentofu" target="_blank" rel="noopener noreferrer">VS Code Marketplace</a> and <a href="https://open-vsx.org/extension/OpenTofu/vscode-opentofu" target="_blank" rel="noopener noreferrer">Open VSX Registry</a></p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="language-server-protocol-support">Language Server Protocol Support<a href="https://opentofu.org/blog/opentofu-1-10-0#language-server-protocol-support" class="hash-link" aria-label="Direct link to Language Server Protocol Support" title="Direct link to Language Server Protocol Support">​</a></h3>
<p>Not a VS Code user? You can get the same powerful features in your preferred editor with <a href="https://github.com/opentofu/tofu-ls" target="_blank" rel="noopener noreferrer">tofu-ls</a>, our Language Server Protocol implementation. This brings OpenTofu intelligence to any LSP-compatible editor including Neovim, Emacs, Sublime Text, and more. Get autocompletion, diagnostics, and documentation lookup wherever you write your infrastructure code.</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="opentofu-registry-mcp-server">OpenTofu Registry MCP Server<a href="https://opentofu.org/blog/opentofu-1-10-0#opentofu-registry-mcp-server" class="hash-link" aria-label="Direct link to OpenTofu Registry MCP Server" title="Direct link to OpenTofu Registry MCP Server">​</a></h3>
<p>For those using AI assistants like Claude, Cursor, or other MCP-compatible tools, the OpenTofu Registry MCP server provides direct access to provider and module documentation. This enables your AI coding assistant to read the latest OpenTofu registry docs and generate accurate, up-to-date infrastructure code with proper resource configurations and best practices. You can use our hosted service at <a href="https://mcp.opentofu.org/mcp" target="_blank" rel="noopener noreferrer">https://mcp.opentofu.org/mcp</a> or run it locally for complete control.</p>
<p><strong><a href="https://github.com/opentofu/opentofu-mcp-server#opentofu-mcp-server" target="_blank" rel="noopener noreferrer">Learn more about the MCP server</a></strong></p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="get-started-today">Get Started Today<a href="https://opentofu.org/blog/opentofu-1-10-0#get-started-today" class="hash-link" aria-label="Direct link to Get Started Today" title="Direct link to Get Started Today">​</a></h2>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="download-and-install">Download and Install<a href="https://opentofu.org/blog/opentofu-1-10-0#download-and-install" class="hash-link" aria-label="Direct link to Download and Install" title="Direct link to Download and Install">​</a></h3>
<p>Getting started with OpenTofu 1.10.0 is easy. You can download it directly from our GitHub releases page, install it via your favorite package manager, or use our official Docker images. We support all major platforms including Linux, macOS, and Windows.</p>
<p><strong><a href="https://opentofu.org/docs/intro/install/">View our installation guides</a></strong></p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="join-the-community">Join the Community<a href="https://opentofu.org/blog/opentofu-1-10-0#join-the-community" class="hash-link" aria-label="Direct link to Join the Community" title="Direct link to Join the Community">​</a></h3>
<p>OpenTofu's success is built on our vibrant community. Join thousands of practitioners sharing knowledge, contributing code, and shaping the future of open-source infrastructure as code. Whether you have questions, want to contribute, or just want to stay updated, there's a place for you.</p>
<p><strong><a href="https://opentofu.org/slack" target="_blank" rel="noopener noreferrer">Join us on Slack</a></strong></p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Help us test OpenTofu 1.10.0-beta1]]></title>
            <link>https://opentofu.org/blog/help-us-test-opentofu-1-10-0-beta1</link>
            <guid>https://opentofu.org/blog/help-us-test-opentofu-1-10-0-beta1</guid>
            <pubDate>Mon, 19 May 2025 00:00:00 GMT</pubDate>
            <description><![CDATA[OpenTofu 1.10.0-beta1 is Now Available]]></description>
            <content:encoded><![CDATA[<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="opentofu-1100-beta1-is-now-available">OpenTofu 1.10.0-beta1 is Now Available<a href="https://opentofu.org/blog/help-us-test-opentofu-1-10-0-beta1#opentofu-1100-beta1-is-now-available" class="hash-link" aria-label="Direct link to OpenTofu 1.10.0-beta1 is Now Available" title="Direct link to OpenTofu 1.10.0-beta1 is Now Available">​</a></h2>
<p>We're excited to announce the beta release of OpenTofu 1.10.0! Thanks to your valuable feedback on our alpha releases, we've refined the features and fixed numerous bugs to bring you this more stable beta version.</p>
<div class="flex flex-col py-2 px-3 not-prose border gap-1 [&amp;+&amp;]:mt-3 [&amp;_a:hover]:text-gray-900 dark:[&amp;_a:hover]:text-gray-50 [&amp;_a>code]:font-bold [&amp;_code]:text-base [&amp;_code]:px-1.5 [&amp;_a]:underline [&amp;_p]:mb-2 bg-yellow-100 border-yellow-500 text-yellow-800 dark:bg-yellow-950 dark:border-yellow-700 dark:text-yellow-100" role="alert"><div class="flex gap-3 font-bold"><span class="flex w-4 fill-current [&amp;>svg]:w-full" aria-hidden="true"><svg viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"></path></svg></span>Warning</div><div class="leading-relaxed"><p>Do not test this release on production projects! This is not a stable release.</p></div></div>
<p>This post focuses primarily on what's new and improved since the <a href="https://opentofu.org/blog/help-us-test-opentofu-1-10-0-alpha2/">1.10.0-alpha2 release</a>. If you're new to the 1.10.0 release cycle, we recommend checking out our previous posts about <a href="https://opentofu.org/blog/help-us-test-opentofu-1-10-0-alpha1/">alpha1</a> and <a href="https://opentofu.org/blog/help-us-test-opentofu-1-10-0-alpha2/">alpha2</a> to learn about major features like OCI Registry integration, native S3 locking, and OpenTelemetry tracing.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="download-and-installation">Download and Installation<a href="https://opentofu.org/blog/help-us-test-opentofu-1-10-0-beta1#download-and-installation" class="hash-link" aria-label="Direct link to Download and Installation" title="Direct link to Download and Installation">​</a></h2>
<p>The beta release is available from the <a href="https://github.com/opentofu/opentofu/releases/tag/v1.10.0-beta1" target="_blank" rel="noopener noreferrer">GitHub Releases page</a>. Select the appropriate file for your platform:</p>
<table><thead><tr><th>Platform</th><th>Download link</th></tr></thead><tbody><tr><td>Windows (64-bit)</td><td><a href="https://github.com/opentofu/opentofu/releases/download/v1.10.0-beta1/tofu_1.10.0-beta1_windows_amd64.zip" target="_blank" rel="noopener noreferrer">tofu_1.10.0-beta1_windows_amd64.zip</a></td></tr><tr><td>macOS (Apple Silicon)</td><td><a href="https://github.com/opentofu/opentofu/releases/download/v1.10.0-beta1/tofu_1.10.0-beta1_darwin_arm64.tar.gz" target="_blank" rel="noopener noreferrer">tofu_1.10.0-beta1_darwin_arm64.tar.gz</a></td></tr><tr><td>macOS (Intel)</td><td><a href="https://github.com/opentofu/opentofu/releases/download/v1.10.0-beta1/tofu_1.10.0-beta1_darwin_amd64.tar.gz" target="_blank" rel="noopener noreferrer">tofu_1.10.0-beta1_darwin_amd64.tar.gz</a></td></tr><tr><td>Linux (AMD64)</td><td><a href="https://github.com/opentofu/opentofu/releases/download/v1.10.0-beta1/tofu_1.10.0-beta1_linux_amd64.tar.gz" target="_blank" rel="noopener noreferrer">tofu_1.10.0-beta1_linux_amd64.tar.gz</a></td></tr><tr><td>Linux (ARM64)</td><td><a href="https://github.com/opentofu/opentofu/releases/download/v1.10.0-beta1/tofu_1.10.0-beta1_linux_arm64.tar.gz" target="_blank" rel="noopener noreferrer">tofu_1.10.0-beta1_linux_arm64.tar.gz</a></td></tr></tbody></table>
<p>After downloading, unpack the archive to find your <code>tofu</code> binary. For verified downloads, you can also use the <a href="https://opentofu.org/docs/intro/install/standalone/" target="_blank" rel="noopener noreferrer">standalone installer</a> with signature verification.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="whats-new-in-1100-beta1">What's New in 1.10.0-beta1<a href="https://opentofu.org/blog/help-us-test-opentofu-1-10-0-beta1#whats-new-in-1100-beta1" class="hash-link" aria-label="Direct link to What's New in 1.10.0-beta1" title="Direct link to What's New in 1.10.0-beta1">​</a></h2>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="oci-registry-enhancements">OCI Registry Enhancements<a href="https://opentofu.org/blog/help-us-test-opentofu-1-10-0-beta1#oci-registry-enhancements" class="hash-link" aria-label="Direct link to OCI Registry Enhancements" title="Direct link to OCI Registry Enhancements">​</a></h3>
<p>Since alpha2, we've refined our OCI registry support with important improvements:</p>
<ul>
<li>Added support for OCI registries that don't report <code>artifactType</code> on layers</li>
<li>Improved e2e test verification for provider installation from OCI mirrors</li>
<li>Enhanced documentation for OCI registry-based provider mirrors</li>
<li>Fixed issues with OCI providers in air-gapped environments</li>
</ul>
<p>If you're using OCI registries for private provider distribution or in air-gapped environments, we'd especially appreciate your testing of these features.</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="global-provider-cache-lock-improvements">Global Provider Cache Lock Improvements<a href="https://opentofu.org/blog/help-us-test-opentofu-1-10-0-beta1#global-provider-cache-lock-improvements" class="hash-link" aria-label="Direct link to Global Provider Cache Lock Improvements" title="Direct link to Global Provider Cache Lock Improvements">​</a></h3>
<p>The shared provider cache (set via the <code>TF_PLUGIN_CACHE_DIR</code> environment variable) now includes filesystem-level locking, making it safe to use with concurrent OpenTofu operations. This is particularly valuable for:</p>
<ul>
<li>CI/CD systems that run multiple <code>tofu init</code> operations in parallel</li>
<li>Orchestration tools that manage multiple OpenTofu pipelines simultaneously</li>
<li>Large-scale Terragrunt setups with many projects</li>
</ul>
<p>Since the alpha releases, we've fixed several edge cases and improved the reliability of this locking mechanism.</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="bug-fixes-and-quality-of-life-improvements">Bug Fixes and Quality-of-Life Improvements<a href="https://opentofu.org/blog/help-us-test-opentofu-1-10-0-beta1#bug-fixes-and-quality-of-life-improvements" class="hash-link" aria-label="Direct link to Bug Fixes and Quality-of-Life Improvements" title="Direct link to Bug Fixes and Quality-of-Life Improvements">​</a></h3>
<p>The beta release includes numerous bug fixes and quality-of-life improvements:</p>
<ul>
<li>Better error messages when using <code>null</code> in invalid positions in the <code>transpose</code> function</li>
<li>Fixed loading of encryption key providers to better support <code>terraform_remote_state</code></li>
<li>Fixed handling of complex variable default values with incorrect types</li>
<li>Fixed module downloads from GitHub branches containing slashes in the name</li>
<li>Improved generation of OpenTofu configuration from <code>import</code> blocks with nested attributes</li>
<li>Added warning when provider references are missing <code>required_providers</code> entries</li>
<li>Fixed an issue where syntax errors in <code>required_providers</code> blocks could cause panics</li>
<li>Improved the PostgreSQL backend to prevent state corruption with parallel runs</li>
</ul>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="key-features-overview-for-new-testers">Key Features Overview for New Testers<a href="https://opentofu.org/blog/help-us-test-opentofu-1-10-0-beta1#key-features-overview-for-new-testers" class="hash-link" aria-label="Direct link to Key Features Overview for New Testers" title="Direct link to Key Features Overview for New Testers">​</a></h2>
<p>If this is your first look at OpenTofu 1.10.0, here's a concise overview of the major features in this release:</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="oci-registry-support">OCI Registry Support<a href="https://opentofu.org/blog/help-us-test-opentofu-1-10-0-beta1#oci-registry-support" class="hash-link" aria-label="Direct link to OCI Registry Support" title="Direct link to OCI Registry Support">​</a></h3>
<p>Full integration with OCI registries for both provider and module distribution, valuable for organizations with private infrastructure-as-code components, air-gapped environments, or enhanced security requirements.</p>
<p>Use module packages from OCI registries directly as a new <a href="https://opentofu.org/docs/language/modules/sources/">module source type</a>:</p>
<div class="language-hcl codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-hcl codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token keyword" style="color:hsl(286, 60%, 67%)">module</span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)"> "vpc" </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">source</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"oci://example.com/modules/vpc/aws"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><br></span></code></pre></figure></div></div>
<p>Configure OCI registry provider mirrors in your <a href="https://opentofu.org/docs/cli/config/config-file/">CLI configuration</a>:</p>
<div class="language-hcl codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-hcl codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token keyword" style="color:hsl(286, 60%, 67%)">provider_installation</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token keyword" style="color:hsl(286, 60%, 67%)">oci_mirror</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">repository_template</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"example.com/opentofu-providers/</span><span class="token string interpolation punctuation" style="color:hsl(220, 14%, 71%)">$</span><span class="token string interpolation punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token string interpolation" style="color:hsl(95, 38%, 62%)">namespace</span><span class="token string interpolation punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token string" style="color:hsl(95, 38%, 62%)">/</span><span class="token string interpolation punctuation" style="color:hsl(220, 14%, 71%)">$</span><span class="token string interpolation punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token string interpolation" style="color:hsl(95, 38%, 62%)">type</span><span class="token string interpolation punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token string" style="color:hsl(95, 38%, 62%)">"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">include</span><span class="token plain">             </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">[</span><span class="token string" style="color:hsl(95, 38%, 62%)">"registry.opentofu.org/*/*"</span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><br></span></code></pre></figure></div></div>
<p>You can find more information on OpenTofu's OCI artifact formats, and instructions for building your own artifacts, in <a href="https://opentofu.org/docs/main/cli/oci_registries/">OCI Registry Integrations</a>.</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="native-s3-locking">Native S3 Locking<a href="https://opentofu.org/blog/help-us-test-opentofu-1-10-0-beta1#native-s3-locking" class="hash-link" aria-label="Direct link to Native S3 Locking" title="Direct link to Native S3 Locking">​</a></h3>
<p>Simplify your infrastructure by using S3's conditional writes capability for state locking, eliminating the need for a separate DynamoDB table.</p>
<div class="language-hcl codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-hcl codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token keyword" style="color:hsl(286, 60%, 67%)">terraform</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token keyword" style="color:hsl(286, 60%, 67%)">backend</span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)"> "s3" </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">bucket</span><span class="token plain">       </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"tofu-state-backend"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">key</span><span class="token plain">          </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"statefile"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">region</span><span class="token plain">       </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"us-east-1"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">use_lockfile</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token boolean" style="color:hsl(29, 54%, 61%)">true</span><span class="token plain">  </span><span class="token comment" style="color:hsl(220, 10%, 40%)"># Enable native S3 locking</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><br></span></code></pre></figure></div></div>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="opentelemetry-tracing">OpenTelemetry Tracing<a href="https://opentofu.org/blog/help-us-test-opentofu-1-10-0-beta1#opentelemetry-tracing" class="hash-link" aria-label="Direct link to OpenTelemetry Tracing" title="Direct link to OpenTelemetry Tracing">​</a></h3>
<p>Gain insights into OpenTofu operations with experimental OpenTelemetry tracing, completely local and under your control.</p>
<div class="language-bash codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-bash codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token comment" style="color:hsl(220, 10%, 40%)"># Launch a tracing backend like Jaeger</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token function" style="color:hsl(207, 82%, 66%)">docker</span><span class="token plain"> run </span><span class="token parameter variable" style="color:hsl(207, 82%, 66%)">-d</span><span class="token plain"> </span><span class="token parameter variable" style="color:hsl(207, 82%, 66%)">--name</span><span class="token plain"> jaeger </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token parameter variable" style="color:hsl(207, 82%, 66%)">-p</span><span class="token plain"> </span><span class="token number" style="color:hsl(29, 54%, 61%)">16686</span><span class="token plain">:16686 </span><span class="token parameter variable" style="color:hsl(207, 82%, 66%)">-p</span><span class="token plain"> </span><span class="token number" style="color:hsl(29, 54%, 61%)">4317</span><span class="token plain">:4317 </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  jaegertracing/jaeger:2.5.0</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token comment" style="color:hsl(220, 10%, 40%)"># Configure OpenTofu to use OpenTelemetry</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token builtin class-name" style="color:hsl(29, 54%, 61%)">export</span><span class="token plain"> </span><span class="token assign-left variable" style="color:hsl(207, 82%, 66%)">OTEL_TRACES_EXPORTER</span><span class="token operator" style="color:hsl(207, 82%, 66%)">=</span><span class="token plain">otlp</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token builtin class-name" style="color:hsl(29, 54%, 61%)">export</span><span class="token plain"> </span><span class="token assign-left variable" style="color:hsl(207, 82%, 66%)">OTEL_EXPORTER_OTLP_ENDPOINT</span><span class="token operator" style="color:hsl(207, 82%, 66%)">=</span><span class="token plain">http://localhost:4317</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token builtin class-name" style="color:hsl(29, 54%, 61%)">export</span><span class="token plain"> </span><span class="token assign-left variable" style="color:hsl(207, 82%, 66%)">OTEL_EXPORTER_OTLP_INSECURE</span><span class="token operator" style="color:hsl(207, 82%, 66%)">=</span><span class="token plain">true</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token comment" style="color:hsl(220, 10%, 40%)"># Run your operations and view traces at http://localhost:16686</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">tofu init</span><br></span></code></pre></figure></div></div>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="resource-management-with-target-files">Resource Management with Target Files<a href="https://opentofu.org/blog/help-us-test-opentofu-1-10-0-beta1#resource-management-with-target-files" class="hash-link" aria-label="Direct link to Resource Management with Target Files" title="Direct link to Resource Management with Target Files">​</a></h3>
<p>Manage complex deployments more easily with the new <code>-target-file</code> and <code>-exclude-file</code> options, allowing version-controlled resource targeting patterns.</p>
<div class="language-bash codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-bash codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token comment" style="color:hsl(220, 10%, 40%)"># Create a targets.txt file</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token comment" style="color:hsl(220, 10%, 40%)"># Critical infrastructure components</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">module.networking.aws_vpc.main</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">module.networking.aws_subnet.public</span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">[</span><span class="token plain">*</span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">]</span><br></span></code></pre></figure></div></div>
<div class="language-bash codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-bash codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token comment" style="color:hsl(220, 10%, 40%)"># Apply only those resources</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">tofu apply -target-file</span><span class="token operator" style="color:hsl(207, 82%, 66%)">=</span><span class="token plain">targets.txt</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token comment" style="color:hsl(220, 10%, 40%)"># Similarly, create an excludes.txt file to skip certain resources</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">tofu plan -exclude-file</span><span class="token operator" style="color:hsl(207, 82%, 66%)">=</span><span class="token plain">excludes.txt</span><br></span></code></pre></figure></div></div>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="support-for-marking-variables-and-outputs-as-deprecated">Support for marking variables and outputs as deprecated<a href="https://opentofu.org/blog/help-us-test-opentofu-1-10-0-beta1#support-for-marking-variables-and-outputs-as-deprecated" class="hash-link" aria-label="Direct link to Support for marking variables and outputs as deprecated" title="Direct link to Support for marking variables and outputs as deprecated">​</a></h3>
<div class="flex flex-col py-2 px-3 not-prose border gap-1 [&amp;+&amp;]:mt-3 [&amp;_a:hover]:text-gray-900 dark:[&amp;_a:hover]:text-gray-50 [&amp;_a>code]:font-bold [&amp;_code]:text-base [&amp;_code]:px-1.5 [&amp;_a]:underline [&amp;_p]:mb-2 bg-yellow-100 border-yellow-500 text-yellow-800 dark:bg-yellow-950 dark:border-yellow-700 dark:text-yellow-100" role="alert"><div class="flex gap-3 font-bold"><span class="flex w-4 fill-current [&amp;>svg]:w-full" aria-hidden="true"><svg viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"></path></svg></span>Warning</div><div class="leading-relaxed"><p>This feature is considered experimental and the final UX may change in the future.</p></div></div>
<p>Module authors can now mark variables and outputs as deprecated which will raise a warning to the users of the module.</p>
<p>This can be easily done by applying the newly supported <code>deprecated</code> attribute to the <code>variable</code> and <code>output</code> blocks.</p>
<p>A <code>variable</code> block marked as <code>deprecated</code>:</p>
<div class="language-hcl codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-hcl codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token keyword" style="color:hsl(286, 60%, 67%)">variable</span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)"> "input" </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">type</span><span class="token plain">       </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> string</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">default</span><span class="token plain">    </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"input value"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">deprecated</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"This variable is deprecated. This will be removed entirely in a future version of the module."</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span></code></pre></figure></div></div>
<p>will generate a warning like the following:</p>
<div class="codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-text codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">│ Warning: Variable marked as deprecated by the module author</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">│ </span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">│   on main.tf line 14, in module "call":</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">│   14:   input = "input value from call"</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">│ </span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">│ Variable "input" is marked as deprecated with the following message:</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">│ This variable is deprecated. This will be removed entirely in a future version of the module.</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">│ </span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">│ (and one more similar warning elsewhere)</span><br></span></code></pre></figure></div></div>
<p>An <code>output</code> block marked as <code>deprecated</code>:</p>
<div class="language-hcl codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-hcl codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token keyword" style="color:hsl(286, 60%, 67%)">output</span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)"> "out" </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">value</span><span class="token plain">      </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"out value"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">deprecated</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"This output is deprecated and will be removed in a future version"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><br></span></code></pre></figure></div></div>
<p>will generate a warning like the following:</p>
<div class="codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-text codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">│ Warning: Value derived from a deprecated source</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">│</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">│   on main.tf line 32, in locals:</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">│   32:   string = module.call.out</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">│</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">│ This value is derived from module.call.out, which is deprecated with the following message:</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">│</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">│ This output is deprecated and will be removed in a future version</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">│</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">│ (and one more similar warning elsewhere)</span><br></span></code></pre></figure></div></div>
<p>For more details regarding this feature, check the official docs on this topic:</p>
<ul>
<li><a href="https://opentofu.org/docs/main/language/values/variables/#marking-variable-as-deprecated" target="_blank" rel="noopener noreferrer">variables</a></li>
<li><a href="https://opentofu.org/docs/main/language/values/outputs/#deprecated--marking-output-as-deprecated" target="_blank" rel="noopener noreferrer">outputs</a></li>
<li><a href="https://opentofu.org/docs/main/language/modules/develop/refactoring/#module-variables-and-outputs" target="_blank" rel="noopener noreferrer">module calls</a></li>
</ul>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="other-major-features">Other Major Features<a href="https://opentofu.org/blog/help-us-test-opentofu-1-10-0-beta1#other-major-features" class="hash-link" aria-label="Direct link to Other Major Features" title="Direct link to Other Major Features">​</a></h3>
<h4 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="external-key-providers-for-state-encryption">External Key Providers for State Encryption<a href="https://opentofu.org/blog/help-us-test-opentofu-1-10-0-beta1#external-key-providers-for-state-encryption" class="hash-link" aria-label="Direct link to External Key Providers for State Encryption" title="Direct link to External Key Providers for State Encryption">​</a></h4>
<p>Configure external commands to retrieve encryption keys, enabling flexible state encryption with your preferred tools:</p>
<div class="language-hcl codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-hcl codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token keyword" style="color:hsl(286, 60%, 67%)">terraform</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token keyword" style="color:hsl(286, 60%, 67%)">encryption</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    key_provider </span><span class="token string" style="color:hsl(95, 38%, 62%)">"external"</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"password_manager"</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      </span><span class="token property" style="color:hsl(355, 65%, 65%)">command</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">[</span><span class="token string" style="color:hsl(95, 38%, 62%)">"./state_encryption_key.sh"</span><span class="token plain">, </span><span class="token string" style="color:hsl(95, 38%, 62%)">"some_parameter"</span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token comment" style="color:hsl(220, 10%, 40%)"># You can also chain key providers together:</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token keyword" style="color:hsl(286, 60%, 67%)">terraform</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token keyword" style="color:hsl(286, 60%, 67%)">encryption</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    key_provider </span><span class="token string" style="color:hsl(95, 38%, 62%)">"external"</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"password_manager"</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      </span><span class="token property" style="color:hsl(355, 65%, 65%)">command</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">[</span><span class="token string" style="color:hsl(95, 38%, 62%)">"./get_password.sh"</span><span class="token plain">, </span><span class="token string" style="color:hsl(95, 38%, 62%)">"some_parameter"</span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    key_provider </span><span class="token string" style="color:hsl(95, 38%, 62%)">"pbkdf2"</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"passphrase"</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      </span><span class="token property" style="color:hsl(355, 65%, 65%)">chain</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> key_provider.external.password_manager</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><br></span></code></pre></figure></div></div>
<h4 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="enhanced-postgresql-backend">Enhanced PostgreSQL Backend<a href="https://opentofu.org/blog/help-us-test-opentofu-1-10-0-beta1#enhanced-postgresql-backend" class="hash-link" aria-label="Direct link to Enhanced PostgreSQL Backend" title="Direct link to Enhanced PostgreSQL Backend">​</a></h4>
<p>The PostgreSQL backend now supports custom table and index names for multi-project state management:</p>
<div class="language-hcl codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-hcl codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token keyword" style="color:hsl(286, 60%, 67%)">terraform</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token keyword" style="color:hsl(286, 60%, 67%)">backend</span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)"> "pg" </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">conn_str</span><span class="token plain">    </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"postgres://user:pass@db.example.com/database"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">schema_name</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"opentofu"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">table_name</span><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"project_a_state"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">index_name</span><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"project_a_index"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><br></span></code></pre></figure></div></div>
<h4 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="resource-type-migration">Resource Type Migration<a href="https://opentofu.org/blog/help-us-test-opentofu-1-10-0-beta1#resource-type-migration" class="hash-link" aria-label="Direct link to Resource Type Migration" title="Direct link to Resource Type Migration">​</a></h4>
<p>The <code>moved</code> block now supports migration between different resource types:</p>
<div class="language-hcl codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-hcl codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token keyword" style="color:hsl(286, 60%, 67%)">moved</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">from</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> gpg_key.this</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">to</span><span class="token plain">   </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> gpg_key_pair.this</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><br></span></code></pre></figure></div></div>
<h4 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="fine-grained-resource-removal">Fine-Grained Resource Removal<a href="https://opentofu.org/blog/help-us-test-opentofu-1-10-0-beta1#fine-grained-resource-removal" class="hash-link" aria-label="Direct link to Fine-Grained Resource Removal" title="Direct link to Fine-Grained Resource Removal">​</a></h4>
<p>The <code>removed</code> block now supports lifecycle and provisioner configurations:</p>
<div class="language-hcl codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-hcl codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token keyword" style="color:hsl(286, 60%, 67%)">removed</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">from</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> aws_instance.legacy_server</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token keyword" style="color:hsl(286, 60%, 67%)">lifecycle</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">destroy</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token boolean" style="color:hsl(29, 54%, 61%)">true</span><span class="token plain">  </span><span class="token comment" style="color:hsl(220, 10%, 40%)"># Destroys the resource (default is false which just forgets it)</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token keyword" style="color:hsl(286, 60%, 67%)">provisioner</span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)"> "local-exec" </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">when</span><span class="token plain">    </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> destroy</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">command</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"echo 'Cleaning up before destroying resource'"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><br></span></code></pre></figure></div></div>
<p>For more details, see our <a href="https://opentofu.org/blog/help-us-test-opentofu-1-10-0-alpha1/">alpha1</a> and <a href="https://opentofu.org/blog/help-us-test-opentofu-1-10-0-alpha2/">alpha2</a> blog posts.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="compatibility-notes">Compatibility Notes<a href="https://opentofu.org/blog/help-us-test-opentofu-1-10-0-beta1#compatibility-notes" class="hash-link" aria-label="Direct link to Compatibility Notes" title="Direct link to Compatibility Notes">​</a></h2>
<p>Before upgrading, please note these key compatibility points:</p>
<ul>
<li>Linux: Requires kernel version 3.2 or later</li>
<li>macOS: Requires macOS 11 Big Sur or later</li>
<li>The <code>ghcr.io/opentofu/opentofu</code> image is no longer supported as a base image</li>
<li>Windows: Symbolic links and junctions are now handled differently</li>
<li>The PostgreSQL backend in OpenTofu 1.10 should not be used alongside older versions</li>
</ul>
<p>For complete details, review the <a href="https://github.com/opentofu/opentofu/blob/main/CHANGELOG.md" target="_blank" rel="noopener noreferrer">full changelog</a>.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="join-the-testing-effort">Join the Testing Effort<a href="https://opentofu.org/blog/help-us-test-opentofu-1-10-0-beta1#join-the-testing-effort" class="hash-link" aria-label="Direct link to Join the Testing Effort" title="Direct link to Join the Testing Effort">​</a></h2>
<p>Your testing and feedback are crucial to ensuring that all these new capabilities work flawlessly across different environments and use cases. If you have a <strong>non-production</strong> environment where you could test any of these capabilities, we'd appreciate your help.</p>
<p>Even if everything works perfectly, please share your testing experiences through <a href="https://github.com/opentofu/opentofu/issues/new/choose" target="_blank" rel="noopener noreferrer">GitHub issues</a> or join the conversation in the <a href="https://opentofu.org/slack/" target="_blank" rel="noopener noreferrer">OpenTofu Slack</a>.</p>
<p>Thank you for your continued support of the OpenTofu project!</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Help us test OpenTofu 1.10.0-alpha2]]></title>
            <link>https://opentofu.org/blog/help-us-test-opentofu-1-10-0-alpha2</link>
            <guid>https://opentofu.org/blog/help-us-test-opentofu-1-10-0-alpha2</guid>
            <pubDate>Fri, 25 Apr 2025 00:00:00 GMT</pubDate>
            <description><![CDATA[Hello, OpenTofu community! We're thrilled to announce the second alpha release of OpenTofu 1.10.0! We have been hard at work adding new features, fixing bugs, and iterating with community feedback. This alpha delivers several long awaited features that we know you have been rooting for.]]></description>
            <content:encoded><![CDATA[<p>Hello, OpenTofu community! We're thrilled to announce the second alpha release of OpenTofu 1.10.0! We have been hard at work adding new features, fixing bugs, and iterating with community feedback. This alpha delivers several long awaited features that we know you have been rooting for.</p>
<p>Your involvement is crucial as we refine these features. If you have a <strong>non-production</strong> environment where you could test any of these new capabilities, we'd be grateful for your help. Even if everything works perfectly (which we hope it does!), your <a href="https://github.com/opentofu/opentofu/issues/new/choose" target="_blank" rel="noopener noreferrer">feedback via GitHub issues</a> is invaluable to ensuring 1.10.0 becomes the rock-solid release our community deserves.</p>
<div class="flex flex-col py-2 px-3 not-prose border gap-1 [&amp;+&amp;]:mt-3 [&amp;_a:hover]:text-gray-900 dark:[&amp;_a:hover]:text-gray-50 [&amp;_a>code]:font-bold [&amp;_code]:text-base [&amp;_code]:px-1.5 [&amp;_a]:underline [&amp;_p]:mb-2 bg-yellow-100 border-yellow-500 text-yellow-800 dark:bg-yellow-950 dark:border-yellow-700 dark:text-yellow-100" role="alert"><div class="flex gap-3 font-bold"><span class="flex w-4 fill-current [&amp;>svg]:w-full" aria-hidden="true"><svg viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"></path></svg></span>Warning</div><div class="leading-relaxed"><p>Do not test this release on a production project! It is not a stable release!</p></div></div>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="downloading-the-alpha-release">Downloading the alpha release<a href="https://opentofu.org/blog/help-us-test-opentofu-1-10-0-alpha2#downloading-the-alpha-release" class="hash-link" aria-label="Direct link to Downloading the alpha release" title="Direct link to Downloading the alpha release">​</a></h2>
<p>The alpha release is available exclusively from the <a href="https://github.com/opentofu/opentofu/releases/tag/v1.10.0-alpha2" target="_blank" rel="noopener noreferrer">GitHub Releases page</a>. Please select the appropriate file for your platform. Here are some quick links:</p>
<table><thead><tr><th>Platform/Device</th><th>Download link</th></tr></thead><tbody><tr><td><strong>Desktop Windows computer</strong><br>(64-bit)</td><td><a href="https://github.com/opentofu/opentofu/releases/download/v1.10.0-alpha2/tofu_1.10.0-alpha2_windows_amd64.zip" target="_blank" rel="noopener noreferrer">tofu_1.10.0-alpha2_windows_amd64.zip</a></td></tr><tr><td><strong>MacOS</strong><br>(Macbook M1 or higher; ARM64)</td><td><a href="https://github.com/opentofu/opentofu/releases/download/v1.10.0-alpha2/tofu_1.10.0-alpha2_darwin_arm64.tar.gz" target="_blank" rel="noopener noreferrer">tofu_1.10.0-alpha2_darwin_arm64.tar.gz</a></td></tr><tr><td><strong>MacOS</strong><br>(Macbook pre-M1; AMD64)</td><td><a href="https://github.com/opentofu/opentofu/releases/download/v1.10.0-alpha2/tofu_1.10.0-alpha2_darwin_amd64.tar.gz" target="_blank" rel="noopener noreferrer">tofu_1.10.0-alpha2_darwin_amd64.tar.gz</a></td></tr><tr><td><strong>Intel/AMD Linux computer or server</strong><br>(AMD64)</td><td><a href="https://github.com/opentofu/opentofu/releases/download/v1.10.0-alpha2/tofu_1.10.0-alpha2_linux_amd64.tar.gz" target="_blank" rel="noopener noreferrer">tofu_1.10.0-alpha2_linux_amd64.tar.gz</a></td></tr><tr><td><strong>ARM-based Linux computer<br>or<br>Raspberry Pi 3 or higher</strong><br>(ARM64)</td><td><a href="https://github.com/opentofu/opentofu/releases/download/v1.10.0-alpha2/tofu_1.10.0-alpha2_linux_arm64.tar.gz" target="_blank" rel="noopener noreferrer">tofu_1.10.0-alpha2_linux_arm64.tar.gz</a></td></tr></tbody></table>
<p>After downloading one of the releases above, unpack the archive to find your <code>tofu</code> binary. For those who prefer verified downloads, you can also use the <a href="https://opentofu.org/docs/intro/install/standalone/" target="_blank" rel="noopener noreferrer">standalone installer</a> with signature verification.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="the-building-blocks-of-1100">The Building Blocks of 1.10.0<a href="https://opentofu.org/blog/help-us-test-opentofu-1-10-0-alpha2#the-building-blocks-of-1100" class="hash-link" aria-label="Direct link to The Building Blocks of 1.10.0" title="Direct link to The Building Blocks of 1.10.0">​</a></h2>
<p>If you're just joining us for alpha 2, OpenTofu 1.10.0 is bringing several groundbreaking features to the table:</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="oci-registry-integration">OCI Registry Integration<a href="https://opentofu.org/blog/help-us-test-opentofu-1-10-0-alpha2#oci-registry-integration" class="hash-link" aria-label="Direct link to OCI Registry Integration" title="Direct link to OCI Registry Integration">​</a></h3>
<p>OpenTofu now seamlessly integrates with OCI registries for both provider distribution and module installation (new for alpha 2). This is a game-changer for private, air-gapped environments and teams looking for more flexible ways to distribute their infrastructure components.</p>
<p>Configure provider installation from OCI Registries with a <code>oci_mirror</code> block:</p>
<div class="language-hcl codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-hcl codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token keyword" style="color:hsl(286, 60%, 67%)">provider_installation</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token keyword" style="color:hsl(286, 60%, 67%)">oci_mirror</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">repository_template</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"example.com/opentofu-providers/</span><span class="token string interpolation punctuation" style="color:hsl(220, 14%, 71%)">$</span><span class="token string interpolation punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token string interpolation" style="color:hsl(95, 38%, 62%)">namespace</span><span class="token string interpolation punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token string" style="color:hsl(95, 38%, 62%)">/</span><span class="token string interpolation punctuation" style="color:hsl(220, 14%, 71%)">$</span><span class="token string interpolation punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token string interpolation" style="color:hsl(95, 38%, 62%)">type</span><span class="token string interpolation punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token string" style="color:hsl(95, 38%, 62%)">"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">include</span><span class="token plain">             </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">[</span><span class="token string" style="color:hsl(95, 38%, 62%)">"registry.opentofu.org/*/*"</span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><br></span></code></pre></figure></div></div>
<p>Or install modules directly using the new <code>oci:</code> source scheme:</p>
<div class="language-hcl codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-hcl codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token keyword" style="color:hsl(286, 60%, 67%)">module</span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)"> "vpc" </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">source</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"oci://example.com/modules/vpc/aws"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><br></span></code></pre></figure></div></div>
<p>For more information, see our <a href="https://opentofu.org/blog/help-us-test-opentofu-1-10-0-alpha1/#provider-distribution-through-oci-registries" target="_blank" rel="noopener noreferrer">alpha 1 blog post</a> for provider instructions and <a href="https://opentofu.org/docs/main/cli/oci_registries/module-package/" target="_blank" rel="noopener noreferrer">our latest docs</a> for module instructions.</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="simplified-state-management-with-native-s3-locking">Simplified State Management with Native S3 Locking<a href="https://opentofu.org/blog/help-us-test-opentofu-1-10-0-alpha2#simplified-state-management-with-native-s3-locking" class="hash-link" aria-label="Direct link to Simplified State Management with Native S3 Locking" title="Direct link to Simplified State Management with Native S3 Locking">​</a></h3>
<p>Why use two services when one will do? The <code>s3</code> backend now supports native locking without requiring DynamoDB, streamlining your state management in AWS environments with the simple addition of <code>use_lockfile</code>:</p>
<div class="language-hcl codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-hcl codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token keyword" style="color:hsl(286, 60%, 67%)">terraform</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token keyword" style="color:hsl(286, 60%, 67%)">backend</span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)"> "s3" </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">bucket</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"tofu-state-backend"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">key</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"statefile"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">region</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"us-east-1"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">use_lockfile</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token boolean" style="color:hsl(29, 54%, 61%)">true</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><br></span></code></pre></figure></div></div>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="peek-behind-the-curtain-with-opentelemetry-tracing">Peek Behind the Curtain with OpenTelemetry Tracing<a href="https://opentofu.org/blog/help-us-test-opentofu-1-10-0-alpha2#peek-behind-the-curtain-with-opentelemetry-tracing" class="hash-link" aria-label="Direct link to Peek Behind the Curtain with OpenTelemetry Tracing" title="Direct link to Peek Behind the Curtain with OpenTelemetry Tracing">​</a></h3>
<p>Ever wondered what's happening under the hood during those long provider installations? Alpha 2 introduces experimental OpenTelemetry (OTel) tracing that gives you unprecedented visibility into OpenTofu's operations.</p>
<div class="flex flex-col py-2 px-3 not-prose border gap-1 [&amp;+&amp;]:mt-3 [&amp;_a:hover]:text-gray-900 dark:[&amp;_a:hover]:text-gray-50 [&amp;_a>code]:font-bold [&amp;_code]:text-base [&amp;_code]:px-1.5 [&amp;_a]:underline [&amp;_p]:mb-2 bg-sky-100 border-sky-300 text-sky-800 dark:bg-sky-950 dark:border-sky-700 dark:text-sky-100" role="alert"><div class="flex gap-3 font-bold"><span class="flex w-4 fill-current [&amp;>svg]:w-full" aria-hidden="true"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>Note</div><div class="leading-relaxed"><p>Although this builds on a project named Open<em>Telemetry</em>, we are adding this support explicitly for you to trace <em>your application</em> using <em>your tooling</em> on <em>your infrastructure</em>. To be absolutely clear: we are <em>not</em> adding telemetry that will phone home to us or anyone else.</p></div></div>
<p>Getting started with tracing takes two steps. First, launch a tracing backend like Jaeger:</p>
<div class="language-bash codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-bash codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token function" style="color:hsl(207, 82%, 66%)">docker</span><span class="token plain"> run </span><span class="token parameter variable" style="color:hsl(207, 82%, 66%)">-d</span><span class="token plain"> </span><span class="token parameter variable" style="color:hsl(207, 82%, 66%)">--rm</span><span class="token plain"> </span><span class="token parameter variable" style="color:hsl(207, 82%, 66%)">--name</span><span class="token plain"> jaeger </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token parameter variable" style="color:hsl(207, 82%, 66%)">-p</span><span class="token plain"> </span><span class="token number" style="color:hsl(29, 54%, 61%)">16686</span><span class="token plain">:16686 </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token parameter variable" style="color:hsl(207, 82%, 66%)">-p</span><span class="token plain"> </span><span class="token number" style="color:hsl(29, 54%, 61%)">4317</span><span class="token plain">:4317 </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token parameter variable" style="color:hsl(207, 82%, 66%)">-p</span><span class="token plain"> </span><span class="token number" style="color:hsl(29, 54%, 61%)">4318</span><span class="token plain">:4318 </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token parameter variable" style="color:hsl(207, 82%, 66%)">-p</span><span class="token plain"> </span><span class="token number" style="color:hsl(29, 54%, 61%)">5778</span><span class="token plain">:5778 </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token parameter variable" style="color:hsl(207, 82%, 66%)">-p</span><span class="token plain"> </span><span class="token number" style="color:hsl(29, 54%, 61%)">9411</span><span class="token plain">:9411 </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">\</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  jaegertracing/jaeger:2.5.0</span><br></span></code></pre></figure></div></div>
<p>Then tell OpenTofu to use it with these environment variables:</p>
<div class="language-bash codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-bash codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token comment" style="color:hsl(220, 10%, 40%)"># Required variables</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token builtin class-name" style="color:hsl(29, 54%, 61%)">export</span><span class="token plain"> </span><span class="token assign-left variable" style="color:hsl(207, 82%, 66%)">OTEL_TRACES_EXPORTER</span><span class="token operator" style="color:hsl(207, 82%, 66%)">=</span><span class="token plain">otlp</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token builtin class-name" style="color:hsl(29, 54%, 61%)">export</span><span class="token plain"> </span><span class="token assign-left variable" style="color:hsl(207, 82%, 66%)">OTEL_EXPORTER_OTLP_ENDPOINT</span><span class="token operator" style="color:hsl(207, 82%, 66%)">=</span><span class="token plain">http://localhost:4317</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token builtin class-name" style="color:hsl(29, 54%, 61%)">export</span><span class="token plain"> </span><span class="token assign-left variable" style="color:hsl(207, 82%, 66%)">OTEL_EXPORTER_OTLP_INSECURE</span><span class="token operator" style="color:hsl(207, 82%, 66%)">=</span><span class="token plain">true</span><br></span></code></pre></figure></div></div>
<p>Now you can watch your OpenTofu operations unfold in real-time through the Jaeger UI at <a href="http://localhost:16686/" target="_blank" rel="noopener noreferrer">http://localhost:16686</a>. Currently, tracing describes:</p>
<ul>
<li>Provider installation and downloads</li>
<li>Lock file operations</li>
</ul>
<p>This is just the beginning – future releases will expand tracing to cover even more of your OpenTofu workflow. Let us know what areas you want more insight into!</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="deprecation-for-module-variables-and-outputs">Deprecation for module variables and outputs<a href="https://opentofu.org/blog/help-us-test-opentofu-1-10-0-alpha2#deprecation-for-module-variables-and-outputs" class="hash-link" aria-label="Direct link to Deprecation for module variables and outputs" title="Direct link to Deprecation for module variables and outputs">​</a></h3>
<p>It is now possible to communicate variable and output deprecation via the <code>deprecated</code> attribute! Module
authors are able to mark variables and outputs as deprecated by including a suggestion on how to migrate. Module callers will receive a warning if their configuration is affected. Here is an example of configuration:</p>
<div class="language-hcl codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-hcl codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token keyword" style="color:hsl(286, 60%, 67%)">variable</span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)"> "examle" </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">type</span><span class="token plain">       </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> string</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">deprecated</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"'examle' variable must no longer be used due to a typo, use 'example' instead"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token keyword" style="color:hsl(286, 60%, 67%)">output</span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)"> "examle" </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">value</span><span class="token plain">      </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"someval"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">deprecated</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"'examle' output must no longer be used due to a typo, use 'example' instead"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><br></span></code></pre></figure></div></div>
<p>For more information, see <a href="https://opentofu.org/docs/main/language/values/variables/#marking-variable-as-deprecated" target="_blank" rel="noopener noreferrer">marking variable as deprecated</a> and <a href="https://opentofu.org/docs/main/language/values/outputs/#deprecated--marking-output-as-deprecated" target="_blank" rel="noopener noreferrer">marking output as deprecated</a></p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="global-provider-cache-locking">Global Provider Cache Locking<a href="https://opentofu.org/blog/help-us-test-opentofu-1-10-0-alpha2#global-provider-cache-locking" class="hash-link" aria-label="Direct link to Global Provider Cache Locking" title="Direct link to Global Provider Cache Locking">​</a></h3>
<p>The <a href="https://opentofu.org/docs/cli/config/config-file/#provider-plugin-cache" target="_blank" rel="noopener noreferrer">Global Provider Plugin Cache</a> allows OpenTofu to download providers into a shared cache directory. Prior to this release, it was not safe to use this with multiple instances of OpenTofu running in parallel as they could clobber each other. We now have added support for filesystem level locking to this cache!</p>
<div class="language-sh codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-sh codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token builtin class-name" style="color:hsl(29, 54%, 61%)">export</span><span class="token plain"> </span><span class="token assign-left variable" style="color:hsl(207, 82%, 66%)">TF_PLUGIN_CACHE_DIR</span><span class="token operator" style="color:hsl(207, 82%, 66%)">=</span><span class="token plain">/storage/tofu/cache</span><br></span></code></pre></figure></div></div>
<p>This now means the global provider plugin cache is safe for tofu to use concurrently:</p>
<ul>
<li>With your CI system that runs dozens of <code>tofu init</code>s in parallel</li>
<li>With your orchestration tool that runs multiple pipelines at the same time</li>
<li>With all of your Terragrunt projects and stacks</li>
</ul>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="multi-project-postgresql-state-management">Multi-Project PostgreSQL State Management<a href="https://opentofu.org/blog/help-us-test-opentofu-1-10-0-alpha2#multi-project-postgresql-state-management" class="hash-link" aria-label="Direct link to Multi-Project PostgreSQL State Management" title="Direct link to Multi-Project PostgreSQL State Management">​</a></h3>
<p>The <code>pg</code> backend gets a significant upgrade with the ability to specify custom table and index names, unlocking multi-project state management within a single database schema:</p>
<div class="language-hcl codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-hcl codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token keyword" style="color:hsl(286, 60%, 67%)">terraform</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token keyword" style="color:hsl(286, 60%, 67%)">backend</span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)"> "pg" </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">conn_str</span><span class="token plain">    </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"postgres://user:pass@db.example.com/database"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">schema_name</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"opentofu"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">table_name</span><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"project_a_state"</span><span class="token plain">  </span><span class="token comment" style="color:hsl(220, 10%, 40%)"># Default is "terraform_state"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">index_name</span><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"project_a_index"</span><span class="token plain">  </span><span class="token comment" style="color:hsl(220, 10%, 40%)"># Default is "terraform_state_idx"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><br></span></code></pre></figure></div></div>
<p>We've also solved an issue that could cause state corruption when sharing a database between different OpenTofu versions, making your state storage more robust than ever.</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="resource-migration-with-moved">Resource Migration with <code>moved</code><a href="https://opentofu.org/blog/help-us-test-opentofu-1-10-0-alpha2#resource-migration-with-moved" class="hash-link" aria-label="Direct link to resource-migration-with-moved" title="Direct link to resource-migration-with-moved">​</a></h3>
<p>The <code>moved</code> block now supports migration between entirely different resource types:</p>
<div class="language-hcl codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-hcl codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token keyword" style="color:hsl(286, 60%, 67%)">moved</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">from</span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain">gpg_key.this</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">to</span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain">gpg_key_pair.this</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><br></span></code></pre></figure></div></div>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="fine-grained-resource-removal-with-removed">Fine-Grained Resource Removal with <code>removed</code><a href="https://opentofu.org/blog/help-us-test-opentofu-1-10-0-alpha2#fine-grained-resource-removal-with-removed" class="hash-link" aria-label="Direct link to fine-grained-resource-removal-with-removed" title="Direct link to fine-grained-resource-removal-with-removed">​</a></h3>
<p>The <code>removed</code> block now supports <code>lifecycle</code> and <code>provisioner</code> configurations:</p>
<div class="language-hcl codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-hcl codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token keyword" style="color:hsl(286, 60%, 67%)">removed</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">from</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> aws_instance.example</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token keyword" style="color:hsl(286, 60%, 67%)">lifecycle</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">destroy</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token boolean" style="color:hsl(29, 54%, 61%)">true</span><span class="token plain">  </span><span class="token comment" style="color:hsl(220, 10%, 40%)"># Destroys the resource (default is false which just forgets it)</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token comment" style="color:hsl(220, 10%, 40%)"># Provisioners will run before destruction when destroy = true</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token keyword" style="color:hsl(286, 60%, 67%)">provisioner</span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)"> "local-exec" </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">when</span><span class="token plain">    </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> destroy</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">command</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"echo 'Cleaning up before destroying resource'"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><br></span></code></pre></figure></div></div>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="streamlined-resource-planning">Streamlined Resource Planning<a href="https://opentofu.org/blog/help-us-test-opentofu-1-10-0-alpha2#streamlined-resource-planning" class="hash-link" aria-label="Direct link to Streamlined Resource Planning" title="Direct link to Streamlined Resource Planning">​</a></h3>
<p>The new <code>-target-file</code> and <code>-exclude-file</code> options transform how you manage complex deployments, allowing you to maintain consistent target and exclusion patterns across your team:</p>
<div class="language-bash codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-bash codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token comment" style="color:hsl(220, 10%, 40%)"># Target specific resources listed in targets.txt</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">tofu plan -target-file</span><span class="token operator" style="color:hsl(207, 82%, 66%)">=</span><span class="token plain">targets.txt</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token comment" style="color:hsl(220, 10%, 40%)"># Exclude specific resources listed in excludes.txt</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">tofu apply -exclude-file</span><span class="token operator" style="color:hsl(207, 82%, 66%)">=</span><span class="token plain">excludes.txt</span><br></span></code></pre></figure></div></div>
<p>No more copy-pasting long resource addresses – just reference your carefully maintained resource lists.</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="flexible-state-encryption-with-external-key-providers">Flexible State Encryption with External Key Providers<a href="https://opentofu.org/blog/help-us-test-opentofu-1-10-0-alpha2#flexible-state-encryption-with-external-key-providers" class="hash-link" aria-label="Direct link to Flexible State Encryption with External Key Providers" title="Direct link to Flexible State Encryption with External Key Providers">​</a></h3>
<p>Security-conscious teams will appreciate the new external key providers for state encryption, bringing unprecedented flexibility to your secret management approach:</p>
<div class="language-hcl codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-hcl codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token keyword" style="color:hsl(286, 60%, 67%)">terraform</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token keyword" style="color:hsl(286, 60%, 67%)">encryption</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    key_provider </span><span class="token string" style="color:hsl(95, 38%, 62%)">"external"</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"password_manager"</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      </span><span class="token property" style="color:hsl(355, 65%, 65%)">command</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">[</span><span class="token string" style="color:hsl(95, 38%, 62%)">"./state_encryption_key.sh"</span><span class="token plain">, </span><span class="token string" style="color:hsl(95, 38%, 62%)">"some_parameter"</span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><br></span></code></pre></figure></div></div>
<p>The PBKDF2 key provider now supports chaining, allowing you to compose multiple key providers:</p>
<div class="language-hcl codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-hcl codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token keyword" style="color:hsl(286, 60%, 67%)">terraform</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token keyword" style="color:hsl(286, 60%, 67%)">encryption</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    key_provider </span><span class="token string" style="color:hsl(95, 38%, 62%)">"external"</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"password_manager"</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      </span><span class="token property" style="color:hsl(355, 65%, 65%)">command</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">[</span><span class="token string" style="color:hsl(95, 38%, 62%)">"./get_password.sh"</span><span class="token plain">, </span><span class="token string" style="color:hsl(95, 38%, 62%)">"some_parameter"</span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    key_provider </span><span class="token string" style="color:hsl(95, 38%, 62%)">"pbkdf2"</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"passphrase"</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      </span><span class="token property" style="color:hsl(355, 65%, 65%)">chain</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> key_provider.external.password_manager</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><br></span></code></pre></figure></div></div>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="and-thats-not-all">And That's Not All<a href="https://opentofu.org/blog/help-us-test-opentofu-1-10-0-alpha2#and-thats-not-all" class="hash-link" aria-label="Direct link to And That's Not All" title="Direct link to And That's Not All">​</a></h3>
<p>Alpha 2 packs numerous other quality-of-life improvements:</p>
<ul>
<li>The <code>element</code> function now accepts negative indices, with <code>-1</code> selecting the last element</li>
<li>Test <code>run</code> outputs can now be referenced in test <code>provider</code> blocks</li>
<li>Force-unlock capability now extends to the HTTP backend</li>
<li>Plan outputs now show forgotten resources count, improving visibility into state changes</li>
</ul>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="before-you-upgrade">Before You Upgrade<a href="https://opentofu.org/blog/help-us-test-opentofu-1-10-0-alpha2#before-you-upgrade" class="hash-link" aria-label="Direct link to Before You Upgrade" title="Direct link to Before You Upgrade">​</a></h2>
<p>As with any significant release, there are some key compatibility points to consider:</p>
<ul>
<li>On Linux, OpenTofu now requires kernel version 3.2 or later</li>
<li>On macOS, OpenTofu now requires macOS 11 Big Sur or later</li>
<li>OpenTofu 1.10 with the <code>pg</code> backend should not be used alongside older versions</li>
<li>The <code>ghcr.io/opentofu/opentofu</code> image is no longer supported as a base image</li>
<li>On Windows, symbolic links and junctions are now handled differently</li>
</ul>
<p>For complete details, please review the <a href="https://github.com/opentofu/opentofu/blob/v1-10-0-alpha2/CHANGELOG.md" target="_blank" rel="noopener noreferrer">full changelog</a>.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="join-the-testing-effort">Join the Testing Effort<a href="https://opentofu.org/blog/help-us-test-opentofu-1-10-0-alpha2#join-the-testing-effort" class="hash-link" aria-label="Direct link to Join the Testing Effort" title="Direct link to Join the Testing Effort">​</a></h2>
<p>OpenTofu 1.10.0 is shaping up to be a landmark release, and your input can help make it truly exceptional. Whether you're intrigued by the OCI registry integration, excited about native S3 locking, or curious about OpenTelemetry tracing, we'd love your feedback.</p>
<p>Share your testing experiences through <a href="https://github.com/opentofu/opentofu/issues/new/choose" target="_blank" rel="noopener noreferrer">GitHub issues</a> or join the conversation in the <a href="https://opentofu.org/slack/" target="_blank" rel="noopener noreferrer">OpenTofu Slack</a>. Every bit of feedback brings us closer to a rock-solid 1.10.0 release.</p>
<p>Thank you!</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Help us test OpenTofu 1.10.0-alpha1]]></title>
            <link>https://opentofu.org/blog/help-us-test-opentofu-1-10-0-alpha1</link>
            <guid>https://opentofu.org/blog/help-us-test-opentofu-1-10-0-alpha1</guid>
            <pubDate>Fri, 28 Mar 2025 00:00:00 GMT</pubDate>
            <description><![CDATA[Hello, OpenTofu community! Today we are proud to announce the first preprelease version of 1.10.0. The new version comes with a few highly anticipated features: provider distribution through OCI registries, native state locking support for s3 backend and many more! We are kindly asking for your help in testing OpenTofu 1.10.0-alpha1.]]></description>
            <content:encoded><![CDATA[<p>Hello, OpenTofu community! Today we are proud to announce the first preprelease version of 1.10.0. The new version comes with a few highly anticipated features: provider distribution through OCI registries, native state locking support for <code>s3</code> backend and many more! We are kindly asking for your help in testing OpenTofu 1.10.0-alpha1.</p>
<p>We have done everything we could to make sure that the new alpha release doesn't break anything, and we need your help to get this release tested. If you have a <strong>non-production</strong> setup that you would be willing to test any of the new features on, please give it a try and give us <a href="https://github.com/opentofu/opentofu/issues/new/choose" target="_blank" rel="noopener noreferrer">feedback using a GitHub issue</a>, even if it's just telling us that everything went well.</p>
<p>This blog post will go over how to download the new preview release and detail how each of the new features works.</p>
<div class="flex flex-col py-2 px-3 not-prose border gap-1 [&amp;+&amp;]:mt-3 [&amp;_a:hover]:text-gray-900 dark:[&amp;_a:hover]:text-gray-50 [&amp;_a>code]:font-bold [&amp;_code]:text-base [&amp;_code]:px-1.5 [&amp;_a]:underline [&amp;_p]:mb-2 bg-yellow-100 border-yellow-500 text-yellow-800 dark:bg-yellow-950 dark:border-yellow-700 dark:text-yellow-100" role="alert"><div class="flex gap-3 font-bold"><span class="flex w-4 fill-current [&amp;>svg]:w-full" aria-hidden="true"><svg viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"></path></svg></span>Warning</div><div class="leading-relaxed"><p>Do not test this release on a production project! It is not a stable release!</p></div></div>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="downloading-the-alpha-release">Downloading the alpha release<a href="https://opentofu.org/blog/help-us-test-opentofu-1-10-0-alpha1#downloading-the-alpha-release" class="hash-link" aria-label="Direct link to Downloading the alpha release" title="Direct link to Downloading the alpha release">​</a></h2>
<p>The alpha release is available exclusively from the <a href="https://github.com/opentofu/opentofu/releases/tag/v1.10.0-alpha1" target="_blank" rel="noopener noreferrer">GitHub Releases page</a>. Please select the appropriate file for your platform. Here are some quick links:</p>
<table><thead><tr><th>Platform/Device</th><th>Download link</th></tr></thead><tbody><tr><td><strong>Desktop Windows computer</strong><br>(64-bit)</td><td><a href="https://github.com/opentofu/opentofu/releases/download/v1.10.0-alpha1/tofu_1.10.0-alpha1_windows_amd64.zip" target="_blank" rel="noopener noreferrer">tofu_1.10.0-alpha1_windows_amd64.zip</a></td></tr><tr><td><strong>MacOS</strong><br>(Macbook M1 or higher; ARM64)</td><td><a href="https://github.com/opentofu/opentofu/releases/download/v1.10.0-alpha1/tofu_1.10.0-alpha1_darwin_arm64.tar.gz" target="_blank" rel="noopener noreferrer">tofu_1.10.0-alpha1_darwin_arm64.tar.gz</a></td></tr><tr><td><strong>MacOS</strong><br>(Macbook pre-M1; AMD64)</td><td><a href="https://github.com/opentofu/opentofu/releases/download/v1.10.0-alpha1/tofu_1.10.0-alpha1_darwin_amd64.tar.gz" target="_blank" rel="noopener noreferrer">tofu_1.10.0-alpha1_darwin_amd64.tar.gz</a></td></tr><tr><td><strong>Intel/AMD Linux computer or server</strong><br>(AMD64)</td><td><a href="https://github.com/opentofu/opentofu/releases/download/v1.10.0-alpha1/tofu_1.10.0-alpha1_linux_amd64.tar.gz" target="_blank" rel="noopener noreferrer">tofu_1.10.0-alpha1_linux_amd64.tar.gz</a></td></tr><tr><td><strong>ARM-based Linux computer<br>or<br>Raspberry Pi 3 or higher</strong><br>(ARM64)</td><td><a href="https://github.com/opentofu/opentofu/releases/download/v1.10.0-alpha1/tofu_1.10.0-alpha1_linux_arm64.tar.gz" target="_blank" rel="noopener noreferrer">tofu_1.10.0-alpha1_linux_arm64.tar.gz</a></td></tr></tbody></table>
<p>For the releases above, please unpack the archive and you should find the <code>tofu</code> binary inside. You can also use the <a href="https://opentofu.org/docs/intro/install/standalone/" target="_blank" rel="noopener noreferrer">standalone installer</a> to download the release with signature verification.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="provider-distribution-through-oci-registries">Provider distribution through OCI registries<a href="https://opentofu.org/blog/help-us-test-opentofu-1-10-0-alpha1#provider-distribution-through-oci-registries" class="hash-link" aria-label="Direct link to Provider distribution through OCI registries" title="Direct link to Provider distribution through OCI registries">​</a></h2>
<p>One of OpenTofu's top-voted issues is to support distribution of providers and modules through OCI registries. This release brings the first part of it - now you can use OCI registries to install a copy of a provider through a special "provider mirror" location.</p>
<p>Creating a local mirror of some or all of the providers you use can reduce data transfer costs and can help with running OpenTofu in "air-gapped" environments that cannot access any services over the public internet.</p>
<p>Alternative provider installation methods are configured as part of <a href="https://opentofu.org/docs/main/cli/config/config-file/" target="_blank" rel="noopener noreferrer">the OpenTofu CLI Configuration</a>. You can configure installation from OCI Registries using an <code>oci_mirror</code> block as part of your <a href="https://opentofu.org/docs/main/cli/config/config-file/#explicit-installation-method-configuration" target="_blank" rel="noopener noreferrer">Explicit Installation Method Configuration</a>:</p>
<div class="language-hcl codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-hcl codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token keyword" style="color:hsl(286, 60%, 67%)">provider_installation</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token keyword" style="color:hsl(286, 60%, 67%)">oci_mirror</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">repository_template</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"example.com/opentofu-providers/</span><span class="token string interpolation punctuation" style="color:hsl(220, 14%, 71%)">$</span><span class="token string interpolation punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token string interpolation" style="color:hsl(95, 38%, 62%)">namespace</span><span class="token string interpolation punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token string" style="color:hsl(95, 38%, 62%)">/</span><span class="token string interpolation punctuation" style="color:hsl(220, 14%, 71%)">$</span><span class="token string interpolation punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token string interpolation" style="color:hsl(95, 38%, 62%)">type</span><span class="token string interpolation punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token string" style="color:hsl(95, 38%, 62%)">"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">include</span><span class="token plain">             </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">[</span><span class="token string" style="color:hsl(95, 38%, 62%)">"registry.opentofu.org/*/*"</span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><br></span></code></pre></figure></div></div>
<p>The above example specifies that any provider that belongs to the primary OpenTofu Registry should instead be installed from a repository in an OCI registry, constructing the repository address dynamically using the components of the provider source address.</p>
<p>We also prepared <a href="https://github.com/opentofu-v1-10-alpha-testing" target="_blank" rel="noopener noreferrer">a full-featured guide</a> on how to test OCI Registry Provider Mirrors.</p>
<p>For more information, please refer to <a href="https://opentofu.org/docs/main/cli/oci_registries/provider-mirror/" target="_blank" rel="noopener noreferrer">the documentation</a>. Also, you can check out our progress via the <a href="https://github.com/opentofu/opentofu/issues/2540" target="_blank" rel="noopener noreferrer">Provider and module packages from OCI registries RFC Tracker</a>.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="native-locking-support-for-s3-backend">Native locking support for <code>s3</code> backend<a href="https://opentofu.org/blog/help-us-test-opentofu-1-10-0-alpha1#native-locking-support-for-s3-backend" class="hash-link" aria-label="Direct link to native-locking-support-for-s3-backend" title="Direct link to native-locking-support-for-s3-backend">​</a></h2>
<p>Now, OpenTofu can leverage native <code>s3</code> conditional writes to eliminate the need of DynamoDB to handle locks. This allows you to rely on a single cloud service to handle both storage and locking of the state file. Please, keep in mind, not all of the s3-compatible storage support this feature yet.</p>
<p>We introduced a new <code>use_lockfile</code> field, which makes OpenTofu create a separate lock file in the same bucket:</p>
<div class="language-hcl codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-hcl codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token keyword" style="color:hsl(286, 60%, 67%)">terraform</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token keyword" style="color:hsl(286, 60%, 67%)">backend</span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)"> "s3" </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">bucket</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"tofu-state-backend"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">key</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"statefile"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">region</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"us-east-1"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">use_lockfile</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token boolean" style="color:hsl(29, 54%, 61%)">true</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><br></span></code></pre></figure></div></div>
<p>For more information, please refer to <a href="https://opentofu.org/docs/main/language/settings/backends/s3/#s3-state-locking" target="_blank" rel="noopener noreferrer">the documentation of the s3 backend</a>.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="what-else">What else?<a href="https://opentofu.org/blog/help-us-test-opentofu-1-10-0-alpha1#what-else" class="hash-link" aria-label="Direct link to What else?" title="Direct link to What else?">​</a></h2>
<p>This release brings a lot more other enhancements such as:</p>
<ul>
<li>External programs as key providers for state encryption;</li>
<li>The <code>element</code> function now accepts negative indices;</li>
<li><code>moved</code> now supports moving between different types;</li>
<li>Multiple enhancements for <code>tofu test</code>;</li>
<li>Count of forgotten resources in plan and apply outputs;</li>
<li>and much more!</li>
</ul>
<p>You can find <a href="https://github.com/opentofu/opentofu/blob/57376f6ec64da8adaa271c1610396fbb86ada549/CHANGELOG.md" target="_blank" rel="noopener noreferrer">the detailed changelog here</a>.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="providing-feedback">Providing feedback<a href="https://opentofu.org/blog/help-us-test-opentofu-1-10-0-alpha1#providing-feedback" class="hash-link" aria-label="Direct link to Providing feedback" title="Direct link to Providing feedback">​</a></h2>
<p>Thank you for taking the time to test this preview release. If you have any feedback, please use <a href="https://github.com/opentofu/opentofu/issues/new/choose" target="_blank" rel="noopener noreferrer">a GitHub issue</a> or chat with us on the <a href="https://opentofu.org/slack/" target="_blank" rel="noopener noreferrer">OpenTofu Slack</a>.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OpenTofu 1.9.0 is available now with provider for_each]]></title>
            <link>https://opentofu.org/blog/opentofu-1-9-0</link>
            <guid>https://opentofu.org/blog/opentofu-1-9-0</guid>
            <pubDate>Fri, 10 Jan 2025 00:00:00 GMT</pubDate>
            <description><![CDATA[OpenTofu 1.9.0 available now with provider for_each, a much-requested feature that makes multi-zone deployments easier and reduces code duplication.]]></description>
            <content:encoded><![CDATA[<p>Today marks the one-year anniversary of the <a href="https://opentofu.org/blog/opentofu-is-going-ga/">1.6 release</a> and we are proud to announce the immediate availability of <a href="https://github.com/opentofu/opentofu/releases/tag/v1.9.0" target="_blank" rel="noopener noreferrer">OpenTofu 1.9.0</a> with a number of features the community has been requesting for some time. Chief among them is provider <code>for_each</code> allowing for easier multi-zone or multi-region deployments. In detail, this release brings:</p>
<ul>
<li>Provider iteration (<code>for_each</code>)</li>
<li>The <code>-exclude</code> flag</li>
<li>Improvements to early evaluation, encryption, AzureRM and HTTP backends</li>
<li>Several new CLI options</li>
<li>Significant performance improvements</li>
</ul>
<p>You can find the full list of improvements and changes on the <a href="https://opentofu.org/docs/intro/whats-new/">What's new in OpenTofu 1.9?</a> page.</p>
<p>In line with our support policy, this release also means that OpenTofu 1.6 is no longer supported and we will not release security updates for it anymore. If you are still using 1.6, please upgrade to at least 1.7.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="massive-growth-300-increase-in-registry-traffic-rising-download-numbers">Massive growth: ~300% increase in registry traffic, rising download numbers<a href="https://opentofu.org/blog/opentofu-1-9-0#massive-growth-300-increase-in-registry-traffic-rising-download-numbers" class="hash-link" aria-label="Direct link to Massive growth: ~300% increase in registry traffic, rising download numbers" title="Direct link to Massive growth: ~300% increase in registry traffic, rising download numbers">​</a></h2>
<p>Yes, you read that right. While our previous release showed <a href="https://opentofu.org/blog/opentofu-1-8-0/">an increase of roughly 30% over a period of 4 months</a>, in the current release the amount of registry requests have tripled to over 6 million requests per day, peaking at a data transfer of over 140 GB per day.</p>
<p><img loading="lazy" alt="A graph showing the OpenTofu registry requests per day" src="https://opentofu.org/assets/images/opentofu-registry-january-2025-6393738f09aa82db216469ab600ef556.svg" width="1542" height="620" class="img_ev3q"></p>
<p>Similarly, the number of GitHub downloads has risen significantly by about 30% in the 1.8 release to almost 1.5 million downloads. Interestingly, we had over 5000 downloads on the 1.9 prerelease versions.</p>
<p><img loading="lazy" alt="A graph showing the OpenTofu GitHub downloads by version" src="https://opentofu.org/assets/images/opentofu-downloads-january-2025-67f8e998d3a72ee3a8f9500de9460c3e.svg" width="1542" height="620" class="img_ev3q">
<img loading="lazy" alt="A graph showing the OpenTofu GitHub downloads by OS" src="https://opentofu.org/assets/images/opentofu-downloads-by-os-january-2025-930454829922d259798e1a4470fd171f.svg" width="1542" height="620" class="img_ev3q"></p>
<p>Apart from users, we also have a very active community helping out with reporting issues, fixing bugs, and helping newcomers with questions. The number of GitHub stars grew to over 23.000, we have received over 150 new issues and the community has been <a href="https://github.com/opentofu/opentofu/issues/1496" target="_blank" rel="noopener noreferrer">actively voting on them</a>. For this release, our community has contributed over 200 pull requests with features and bugfixes from 49 contributors on the main repository alone.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="opentofu-search-beta">OpenTofu Search (beta)<a href="https://opentofu.org/blog/opentofu-1-9-0#opentofu-search-beta" class="hash-link" aria-label="Direct link to OpenTofu Search (beta)" title="Direct link to OpenTofu Search (beta)">​</a></h2>
<p>Since our last release, we have indexed the documentation of over 4.000 providers and over 20.000 modules in the <a href="https://search.opentofu.org/" target="_blank" rel="noopener noreferrer">OpenTofu Search</a> interface. This was a monumental effort producing over 146 GB of raw data and the project updates the documentation for new provider and module versions every 15-30 minutes. Thanks to the generous sponsorship by Cloudflare, our costs for maintaining this infrastructure are minimal. It took over 12.000 lines of combined Go and Typescript code to accomplish.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="jetbrains-support">JetBrains support<a href="https://opentofu.org/blog/opentofu-1-9-0#jetbrains-support" class="hash-link" aria-label="Direct link to JetBrains support" title="Direct link to JetBrains support">​</a></h2>
<p>In their 2024.3 release, <a href="https://www.jetbrains.com/idea/whatsnew/2024-3/" target="_blank" rel="noopener noreferrer">JetBrains has announced support for OpenTofu</a>. The integration switches to OpenTofu when it detects a <code>.tofu</code> file in a project and provides OpenTofu-specific code completion, such as state encryption.</p>
<p><img loading="lazy" alt="A screenshot showing OpenTofu support in Goland" src="https://opentofu.org/assets/images/jetbrains-opentofu-support-d55181557e8d07e4685bd7b7f7e41742.png" width="1366" height="754" class="img_ev3q"></p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="visual-studio-code-integration">Visual Studio Code integration<a href="https://opentofu.org/blog/opentofu-1-9-0#visual-studio-code-integration" class="hash-link" aria-label="Direct link to Visual Studio Code integration" title="Direct link to Visual Studio Code integration">​</a></h2>
<p>In parallel, the OpenTofu core team started working with the community on <a href="https://github.com/opentofu/vscode-opentofu" target="_blank" rel="noopener noreferrer">a possible port of the Visual Studio Code extension for OpenTofu</a>.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="future-plans">Future plans<a href="https://opentofu.org/blog/opentofu-1-9-0#future-plans" class="hash-link" aria-label="Direct link to Future plans" title="Direct link to Future plans">​</a></h2>
<p>With provider iteration now implemented, we are turning our attention to the other <a href="https://github.com/opentofu/opentofu/issues/1496" target="_blank" rel="noopener noreferrer">much-requested features</a>. Most importantly, we already have a working prototype for the OCI provider registry and we are also <a href="https://github.com/opentofu/opentofu/pulls?q=is%3Apr+is%3Aopen+oci+rfc" target="_blank" rel="noopener noreferrer">looking for your input on the related RFCs</a>. For more details on upcoming features take a look at the <a href="https://github.com/opentofu/opentofu/milestone/11" target="_blank" rel="noopener noreferrer">1.10.0 planning milestone</a> on GitHub.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Get ready for OpenTofu Beta 1.9.0]]></title>
            <link>https://opentofu.org/blog/opentofu-1-9-0-beta1</link>
            <guid>https://opentofu.org/blog/opentofu-1-9-0-beta1</guid>
            <pubDate>Thu, 05 Dec 2024 00:00:00 GMT</pubDate>
            <description><![CDATA[Hey there, OpenTofu community! We've been working hard to refine the 1.9.0-alpha2 with your feedback! A few rough edges have been polished and a few new features have been added.]]></description>
            <content:encoded><![CDATA[<p>Hey there, OpenTofu community! We've been working hard to refine the <a href="https://opentofu.org/blog/help-us-test-opentofu-1-9-0-alpha2/">1.9.0-alpha2</a> with your feedback! A few rough edges have been polished and a few new features have been added.</p>
<p>If you have a <strong>non-production</strong> setup that you would be willing to test any of the new features on, please give it a try and give us <a href="https://github.com/opentofu/opentofu/issues/new/choose" target="_blank" rel="noopener noreferrer">feedback using a GitHub issue</a>, even if it's just telling us that everything went well.</p>
<p>This blog post will go over how to download the new preview release and expand on the features presented in the <a href="https://opentofu.org/blog/help-us-test-opentofu-1-9-0-alpha2/">1.9.0-alpha2 blog post</a>.</p>
<div class="flex flex-col py-2 px-3 not-prose border gap-1 [&amp;+&amp;]:mt-3 [&amp;_a:hover]:text-gray-900 dark:[&amp;_a:hover]:text-gray-50 [&amp;_a>code]:font-bold [&amp;_code]:text-base [&amp;_code]:px-1.5 [&amp;_a]:underline [&amp;_p]:mb-2 bg-yellow-100 border-yellow-500 text-yellow-800 dark:bg-yellow-950 dark:border-yellow-700 dark:text-yellow-100" role="alert"><div class="flex gap-3 font-bold"><span class="flex w-4 fill-current [&amp;>svg]:w-full" aria-hidden="true"><svg viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"></path></svg></span>Warning</div><div class="leading-relaxed"><p>Do not test this release on a production project! It is not a stable release!</p></div></div>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="downloading-the-beta-release">Downloading the beta release<a href="https://opentofu.org/blog/opentofu-1-9-0-beta1#downloading-the-beta-release" class="hash-link" aria-label="Direct link to Downloading the beta release" title="Direct link to Downloading the beta release">​</a></h2>
<p>The beta release is available exclusively from the <a href="https://github.com/opentofu/opentofu/releases/tag/v1.9.0-beta1" target="_blank" rel="noopener noreferrer">GitHub Releases page</a>. Please select the appropriate file for your platform. Here are some quick links:</p>
<table><thead><tr><th>Platform/Device</th><th>Download link</th></tr></thead><tbody><tr><td><strong>Desktop Windows computer</strong><br>(64-bit)</td><td><a href="https://github.com/opentofu/opentofu/releases/download/v1.9.0-beta1/tofu_1.9.0-beta1_windows_amd64.zip" target="_blank" rel="noopener noreferrer">tofu_1.9.0-beta1_windows_amd64.zip</a></td></tr><tr><td><strong>MacOS</strong><br>(Macbook M1 or higher; ARM64)</td><td><a href="https://github.com/opentofu/opentofu/releases/download/v1.9.0-beta1/tofu_1.9.0-beta1_darwin_arm64.tar.gz" target="_blank" rel="noopener noreferrer">tofu_1.9.0-beta1_darwin_arm64.tar.gz</a></td></tr><tr><td><strong>MacOS</strong><br>(Macbook pre-M1; AMD64)</td><td><a href="https://github.com/opentofu/opentofu/releases/download/v1.9.0-beta1/tofu_1.9.0-beta1_darwin_amd64.tar.gz" target="_blank" rel="noopener noreferrer">tofu_1.9.0-beta1_darwin_amd64.tar.gz</a></td></tr><tr><td><strong>Intel/AMD Linux computer or server</strong><br>(AMD64)</td><td><a href="https://github.com/opentofu/opentofu/releases/download/v1.9.0-beta1/tofu_1.9.0-beta1_linux_amd64.tar.gz" target="_blank" rel="noopener noreferrer">tofu_1.9.0-beta1_linux_amd64.tar.gz</a></td></tr><tr><td><strong>ARM-based Linux computer<br>or<br>Raspberry Pi 3 or higher</strong><br>(ARM64)</td><td><a href="https://github.com/opentofu/opentofu/releases/download/v1.9.0-beta1/tofu_1.9.0-beta1_linux_arm64.tar.gz" target="_blank" rel="noopener noreferrer">tofu_1.9.0-beta1_linux_arm64.tar.gz</a></td></tr></tbody></table>
<p>For the releases above, please unpack the archive and you should find the <code>tofu</code> binary inside. You can also use the <a href="https://opentofu.org/docs/intro/install/standalone/" target="_blank" rel="noopener noreferrer">standalone installer</a> to download the release with signature verification.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="provider-iteration-for_each">Provider iteration (<code>for_each</code>)<a href="https://opentofu.org/blog/opentofu-1-9-0-beta1#provider-iteration-for_each" class="hash-link" aria-label="Direct link to provider-iteration-for_each" title="Direct link to provider-iteration-for_each">​</a></h2>
<p>One of the biggest challenges keeping the code clean in a multi-region or multi-zone deployment is the sheer number of providers and related configurations you have to juggle. Essentially, you will have to create duplicated code for each region or zone.</p>
<p>With provider iteration, you can now get rid of your code duplications by iterating over a set of providers instead of the duplicated code. If you have a small-scale setup with one of the cloud providers offering multiple zones, start by adding two variables:</p>
<div class="language-hcl codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-hcl codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token keyword" style="color:hsl(286, 60%, 67%)">variable</span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)"> "regions" </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">description</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"A list of regions that should have a deployment."</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">type</span><span class="token plain">        </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> set(string)</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token keyword" style="color:hsl(286, 60%, 67%)">variable</span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)"> "disabled_regions" </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">description</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"A list of regions that should be disabled and all resources removed."</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">type</span><span class="token plain">        </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> set(string)</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">default</span><span class="token plain">     </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">[</span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><br></span></code></pre></figure></div></div>
<p>The <code>regions</code> variable serves as a list of regions you will want to deploy to. The <code>disabled_regions</code> variable will allow you to remove a region later without removing the provider. This feature is extremely important because if you remove the provider without removing its resources, OpenTofu will be unable to remove the resources in that region.</p>
<p>As a next step, you can create your provider declarations. As you can see, this is only a single declaration. The only restriction worth mentioning here is the <code>alias</code>. Due to technical limitations, in this version you can only use <code>for_each</code> in conjunction with <code>alias</code>.</p>
<div class="language-hcl codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-hcl codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token keyword" style="color:hsl(286, 60%, 67%)">provider</span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)"> "aws" </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">alias</span><span class="token plain">    </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"by_region"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">region</span><span class="token plain">   </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> each.value</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">for_each</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> var.regions</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><br></span></code></pre></figure></div></div>
<p>Finally, you can use the provider set to call a submodule. Note that in contrast to the <code>provider</code> block above, the <code>for_each</code> iterates only over the providers that are not disabled. This lets you deprovision a region properly and later completely remove the provider.</p>
<div class="language-hcl codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-hcl codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token keyword" style="color:hsl(286, 60%, 67%)">module</span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)"> "deploy" </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">source</span><span class="token plain">    </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"./deploy"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">providers</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">aws</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> aws.by_region</span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">[</span><span class="token plain">each.key</span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">for_each</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> setsubtract(var.regions, var.disabled_regions)</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><br></span></code></pre></figure></div></div>
<p>As this feature is very new, there are a few limitations in place you may want to observe:</p>
<ol>
<li>You can only use <code>for_each</code> on variables and locals that can be obtained statically. Expressions that rely on data sources or resources are currently not usable.</li>
<li>If you have an already-deployed infrastructure, don't simply remove a provider from the list as this will make it impossible for OpenTofu to destroy the infrastructure in this region. Instead, you will need to implement removing that infrastructure first and then remove the provider from the list. See the <code>disabled_regions</code> variable for an example above.</li>
<li>Currently, each provider used in a <code>for_each</code> <strong>must</strong> have an alias. Providers without aliases are not supported for now due to internal technical reasons.</li>
<li>There is currently no way to pass a set of providers to a module, you can only pass individual providers.</li>
</ol>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="the--exclude-flag">The <code>-exclude</code> flag<a href="https://opentofu.org/blog/opentofu-1-9-0-beta1#the--exclude-flag" class="hash-link" aria-label="Direct link to the--exclude-flag" title="Direct link to the--exclude-flag">​</a></h2>
<p>OpenTofu already has a <code>-target</code> option to only plan or apply certain resources. Why not apply everything except a certain resource? This was the thought behind the <code>-exclude</code> flag and, in fact, this was one of the highest upvoted feature requests for this release.</p>
<p>You can test it by creating the following simple configuration:</p>
<div class="language-hcl codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-hcl codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token keyword" style="color:hsl(286, 60%, 67%)">resource </span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)">"local_file"</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"a"</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">filename</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"a.txt"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">content</span><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"a"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token keyword" style="color:hsl(286, 60%, 67%)">resource </span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)">"local_file"</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"b"</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">filename</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"b.txt"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">content</span><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"b"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token keyword" style="color:hsl(286, 60%, 67%)">resource </span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)">"local_file"</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"c"</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">filename</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"c.txt"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">content</span><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"c"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><br></span></code></pre></figure></div></div>
<p>If you run <code>tofu apply -exclude local_file.b</code>, you will see that OpenTofu creates <code>a.txt</code> and <code>c.txt</code>, but not <code>b.txt</code>.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="bugfixes-and-improvements">Bugfixes and improvements<a href="https://opentofu.org/blog/opentofu-1-9-0-beta1#bugfixes-and-improvements" class="hash-link" aria-label="Direct link to Bugfixes and improvements" title="Direct link to Bugfixes and improvements">​</a></h2>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="early-evaluation-improvements">Early evaluation improvements<a href="https://opentofu.org/blog/opentofu-1-9-0-beta1#early-evaluation-improvements" class="hash-link" aria-label="Direct link to Early evaluation improvements" title="Direct link to Early evaluation improvements">​</a></h3>
<p>When using early evaluation introduced in OpenTofu 1.8, OpenTofu will now prompt you for the variables needed for evaluation.</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="the-new-encrypted_metadata_alias-option-for-state-encryption">The new <code>encrypted_metadata_alias</code> option for state encryption<a href="https://opentofu.org/blog/opentofu-1-9-0-beta1#the-new-encrypted_metadata_alias-option-for-state-encryption" class="hash-link" aria-label="Direct link to the-new-encrypted_metadata_alias-option-for-state-encryption" title="Direct link to the-new-encrypted_metadata_alias-option-for-state-encryption">​</a></h3>
<p>One of the tricky parts when using state encryption in previous versions is that OpenTofu needs to store the name of the key provider into the encrypted data alongside some metadata needed for decryption. This meant that changing the key provider name would involve using a <code>fallback</code> block and key provider naming for remote state data sources would have to be synchronized. With OpenTofu 1.9, we are introducing a new <code>encrypted_metadata_alias</code> option you can use to explicitly set the ID stored with the encrypted data:</p>
<div class="language-hcl codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-hcl codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token keyword" style="color:hsl(286, 60%, 67%)">terraform</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token keyword" style="color:hsl(286, 60%, 67%)">encryption</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    key_provider </span><span class="token string" style="color:hsl(95, 38%, 62%)">"pbkdf2"</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"mykey"</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      </span><span class="token property" style="color:hsl(355, 65%, 65%)">passphrase</span><span class="token plain">               </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"OpenTofu has encryption"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      </span><span class="token comment" style="color:hsl(220, 10%, 40%)"># Note the fixed encrypted_metadata_alias here:</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      </span><span class="token property" style="color:hsl(355, 65%, 65%)">encrypted_metadata_alias</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"certificates"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    method </span><span class="token string" style="color:hsl(95, 38%, 62%)">"aes_gcm"</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"mymethod"</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      </span><span class="token property" style="color:hsl(355, 65%, 65%)">keys</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> key_provider.pbkdf2.mykey</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token keyword" style="color:hsl(286, 60%, 67%)">state</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      </span><span class="token property" style="color:hsl(355, 65%, 65%)">method</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> method.aes_gcm.mymethod</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><br></span></code></pre></figure></div></div>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="logging-and-other-improvements">Logging and other improvements<a href="https://opentofu.org/blog/opentofu-1-9-0-beta1#logging-and-other-improvements" class="hash-link" aria-label="Direct link to Logging and other improvements" title="Direct link to Logging and other improvements">​</a></h3>
<ul>
<li>You can now use the <code>-consolidate-warnings</code> and <code>-consolidate-errors</code> options to consolidate similar warnings and errors together.</li>
<li>The HTTP backend now supports extended trace logging, including request and response bodies.</li>
<li>OpenTofu will now prompt for values for input variables needed for early evaluation.</li>
<li><code>tofu console</code> now accepts expressions split over multiple lines, when the newline characters appear inside bracketing pairs or when they are escaped using a backslash.</li>
<li><code>tofu test</code> now throws errors instead of warnings for invalid override and mock fields.</li>
<li>Several performance improvements for large graphs and large amounts of submodules.</li>
</ul>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="providing-feedback">Providing feedback<a href="https://opentofu.org/blog/opentofu-1-9-0-beta1#providing-feedback" class="hash-link" aria-label="Direct link to Providing feedback" title="Direct link to Providing feedback">​</a></h2>
<p>Thank you for taking the time to test this preview release. If you have any feedback, please use <a href="https://github.com/opentofu/opentofu/issues/new/choose" target="_blank" rel="noopener noreferrer">a GitHub issue</a> or chat with us on the <a href="https://opentofu.org/slack/" target="_blank" rel="noopener noreferrer">OpenTofu Slack</a>.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Help us test OpenTofu 1.9.0-alpha2]]></title>
            <link>https://opentofu.org/blog/help-us-test-opentofu-1-9-0-alpha2</link>
            <guid>https://opentofu.org/blog/help-us-test-opentofu-1-9-0-alpha2</guid>
            <pubDate>Mon, 11 Nov 2024 00:00:00 GMT</pubDate>
            <description><![CDATA[Hello everyone! As we have taken on one of the most difficult tasks since the inception of OpenTofu and it's been a while since we last released a feature version. Today, we are very proud to ask for your help in testing OpenTofu 1.9.0-alpha2, coming with a much-requested feature: provider iteration using for_each. Additionally, this release includes the new -exclude flag for plan and apply.]]></description>
            <content:encoded><![CDATA[<p>Hello everyone! As we have taken on one of the most difficult tasks since the inception of OpenTofu and it's been a while since we last released a feature version. Today, we are very proud to ask for your help in testing OpenTofu 1.9.0-alpha2, coming with a much-requested feature: provider iteration using <code>for_each</code>. Additionally, this release includes the new <code>-exclude</code> flag for plan and apply.</p>
<p>We have done everything we could to make sure that the new alpha release doesn't break anything, and we need your help to get this release tested. If you have a <strong>non-production</strong> setup that you would be willing to test any of the new features on, please give it a try and give us <a href="https://github.com/opentofu/opentofu/issues/new/choose" target="_blank" rel="noopener noreferrer">feedback using a GitHub issue</a>, even if it's just telling us that everything went well.</p>
<p>This blog post will go over how to download the new preview release and detail how each of the new features works.</p>
<div class="flex flex-col py-2 px-3 not-prose border gap-1 [&amp;+&amp;]:mt-3 [&amp;_a:hover]:text-gray-900 dark:[&amp;_a:hover]:text-gray-50 [&amp;_a>code]:font-bold [&amp;_code]:text-base [&amp;_code]:px-1.5 [&amp;_a]:underline [&amp;_p]:mb-2 bg-yellow-100 border-yellow-500 text-yellow-800 dark:bg-yellow-950 dark:border-yellow-700 dark:text-yellow-100" role="alert"><div class="flex gap-3 font-bold"><span class="flex w-4 fill-current [&amp;>svg]:w-full" aria-hidden="true"><svg viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"></path></svg></span>Warning</div><div class="leading-relaxed"><p>Do not test this release on a production project! It is not a stable release!</p></div></div>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="downloading-the-alpha-release">Downloading the alpha release<a href="https://opentofu.org/blog/help-us-test-opentofu-1-9-0-alpha2#downloading-the-alpha-release" class="hash-link" aria-label="Direct link to Downloading the alpha release" title="Direct link to Downloading the alpha release">​</a></h2>
<p>The alpha release is available exclusively from the <a href="https://github.com/opentofu/opentofu/releases/tag/v1.9.0-alpha2" target="_blank" rel="noopener noreferrer">GitHub Releases page</a>. Please select the appropriate file for your platform. Here are some quick links:</p>
<table><thead><tr><th>Platform/Device</th><th>Download link</th></tr></thead><tbody><tr><td><strong>Desktop Windows computer</strong><br>(64-bit)</td><td><a href="https://github.com/opentofu/opentofu/releases/download/v1.9.0-alpha2/tofu_1.9.0-alpha2_windows_amd64.zip" target="_blank" rel="noopener noreferrer">tofu_1.9.0-alpha2_windows_amd64.zip</a></td></tr><tr><td><strong>MacOS</strong><br>(Macbook M1 or higher; ARM64)</td><td><a href="https://github.com/opentofu/opentofu/releases/download/v1.9.0-alpha2/tofu_1.9.0-alpha2_darwin_arm64.tar.gz" target="_blank" rel="noopener noreferrer">tofu_1.9.0-alpha2_darwin_arm64.tar.gz</a></td></tr><tr><td><strong>MacOS</strong><br>(Macbook pre-M1; AMD64)</td><td><a href="https://github.com/opentofu/opentofu/releases/download/v1.9.0-alpha2/tofu_1.9.0-alpha2_darwin_amd64.tar.gz" target="_blank" rel="noopener noreferrer">tofu_1.9.0-alpha2_darwin_amd64.tar.gz</a></td></tr><tr><td><strong>Intel/AMD Linux computer or server</strong><br>(AMD64)</td><td><a href="https://github.com/opentofu/opentofu/releases/download/v1.9.0-alpha2/tofu_1.9.0-alpha2_linux_amd64.tar.gz" target="_blank" rel="noopener noreferrer">tofu_1.9.0-alpha2_linux_amd64.tar.gz</a></td></tr><tr><td><strong>ARM-based Linux computer<br>or<br>Raspberry Pi 3 or higher</strong><br>(ARM64)</td><td><a href="https://github.com/opentofu/opentofu/releases/download/v1.9.0-alpha2/tofu_1.9.0-alpha2_linux_arm64.tar.gz" target="_blank" rel="noopener noreferrer">tofu_1.9.0-alpha2_linux_arm64.tar.gz</a></td></tr></tbody></table>
<p>For the releases above, please unpack the archive and you should find the <code>tofu</code> binary inside. You can also use the <a href="https://opentofu.org/docs/intro/install/standalone/" target="_blank" rel="noopener noreferrer">standalone installer</a> to download the release with signature verification.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="provider-for_each">Provider <code>for_each</code><a href="https://opentofu.org/blog/help-us-test-opentofu-1-9-0-alpha2#provider-for_each" class="hash-link" aria-label="Direct link to provider-for_each" title="Direct link to provider-for_each">​</a></h2>
<p>Imagine you have to deploy an infrastructure that involves multiple regions using your cloud provider. In order to minimize code duplication, you created a module that you can use for each region. However, your main module still looks like this:</p>
<div class="language-hcl codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-hcl codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token keyword" style="color:hsl(286, 60%, 67%)">provider</span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)"> "aws" </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">alias</span><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"useast"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">region</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"us-east-1"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token keyword" style="color:hsl(286, 60%, 67%)">provider</span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)"> "aws" </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">alias</span><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"uswest"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">region</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"us-west-1"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token keyword" style="color:hsl(286, 60%, 67%)">provider</span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)"> "aws" </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">alias</span><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"eucentral"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">region</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"eu-central-1"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token keyword" style="color:hsl(286, 60%, 67%)">module</span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)"> "deploy-useast" </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">source</span><span class="token plain">    </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"./deploy"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">providers</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">aws</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> aws.useast</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token keyword" style="color:hsl(286, 60%, 67%)">module</span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)"> "deploy-uswest" </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">source</span><span class="token plain">    </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"./deploy"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">providers</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">aws</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> aws.uswest</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token keyword" style="color:hsl(286, 60%, 67%)">module</span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)"> "deploy-eucentral" </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">source</span><span class="token plain">    </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"./deploy"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">providers</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">aws</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> aws.eucentral</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><br></span></code></pre></figure></div></div>
<p>Starting OpenTofu 1.9, you can now use a <code>for_each</code> instead:</p>
<div class="language-hcl codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-hcl codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token keyword" style="color:hsl(286, 60%, 67%)">variable</span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)"> "regions" </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">description</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"A list of regions that should have a deployment."</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">type</span><span class="token plain">        </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> set(string)</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token keyword" style="color:hsl(286, 60%, 67%)">variable</span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)"> "disabled_regions" </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">description</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"A list of regions that should be disabled and all resources removed."</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">type</span><span class="token plain">        </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> set(string)</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">default</span><span class="token plain">     </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">[</span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token keyword" style="color:hsl(286, 60%, 67%)">provider</span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)"> "aws" </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">alias</span><span class="token plain">    </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"by_region"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">region</span><span class="token plain">   </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> each.value</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">for_each</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> var.regions</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token keyword" style="color:hsl(286, 60%, 67%)">module</span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)"> "deploy" </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">source</span><span class="token plain">    </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"./deploy"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">providers</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">aws</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> aws.by_region</span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">[</span><span class="token plain">each.key</span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token comment" style="color:hsl(220, 10%, 40%)">// Here we make sure that all resources from a region are removed</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token comment" style="color:hsl(220, 10%, 40%)">// if the region is disabled. This must be done before removing</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token comment" style="color:hsl(220, 10%, 40%)">// a region entirely.</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">for_each</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> setsubtract(var.regions, var.disabled_regions)</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><br></span></code></pre></figure></div></div>
<p>As you can see, you can pass in the set of regions using a variable and then call the module as many times as you need it.</p>
<p>However, there are some important considerations to remember when using <code>for_each</code> in this manner:</p>
<ol>
<li>You can only use <code>for_each</code> on variables and locals that can be obtained statically. Expressions that rely on data sources or resources are currently not usable.</li>
<li>If you have an already-deployed infrastructure, don't simply remove a provider from the list as this will make it impossible for OpenTofu to destroy the infrastructure in this region. Instead, you will need to implement removing that infrastructure first and then remove the provider from the list. See the <code>disabled_regions</code> variable for an example above.</li>
<li>Currently, each provider used in a <code>for_each</code> <strong>must</strong> have an alias. Providers without aliases are not supported for now due to internal technical reasons.</li>
<li>There is currently no way to pass a set of providers to a module, you can only pass individual providers.</li>
</ol>
<p>We are actively working on resolving these limitations and future OpenTofu versions will see this capability improved.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="exclude-on-plan-and-apply">Exclude on plan and apply<a href="https://opentofu.org/blog/help-us-test-opentofu-1-9-0-alpha2#exclude-on-plan-and-apply" class="hash-link" aria-label="Direct link to Exclude on plan and apply" title="Direct link to Exclude on plan and apply">​</a></h2>
<p>This flag is small but powerful: similar to <code>-target</code>, you can now tell OpenTofu to ignore a certain resource when applying your configuration.</p>
<p>For example:</p>
<div class="language-hcl2 codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-hcl2 codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">tofu plan -exclude=kubernetes_manifest.crds</span><br></span></code></pre></figure></div></div>
<p>In this case, OpenTofu will ignore <code>kubernetes_manifest.crds</code> during planning.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="providing-feedback">Providing feedback<a href="https://opentofu.org/blog/help-us-test-opentofu-1-9-0-alpha2#providing-feedback" class="hash-link" aria-label="Direct link to Providing feedback" title="Direct link to Providing feedback">​</a></h2>
<p>Thank you for taking the time to test this preview release. If you have any feedback, please use <a href="https://github.com/opentofu/opentofu/issues/new/choose" target="_blank" rel="noopener noreferrer">a GitHub issue</a> or chat with us on the <a href="https://opentofu.org/slack/" target="_blank" rel="noopener noreferrer">OpenTofu Slack</a>.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building the OpenTofu Registry]]></title>
            <link>https://opentofu.org/blog/building-the-opentofu-registry</link>
            <guid>https://opentofu.org/blog/building-the-opentofu-registry</guid>
            <pubDate>Thu, 12 Sep 2024 00:00:00 GMT</pubDate>
            <description><![CDATA[With the Registry Search now in beta it is time to take a technical deep dive into how the OpenTofu Registry and Search work and what it took to build them.]]></description>
            <content:encoded><![CDATA[<p>Recently, we published the beta version of the <a href="https://search.opentofu.org/" target="_blank" rel="noopener noreferrer">OpenTofu Registry Search</a>, a user interface that lets you search for and view the documentation of providers and modules in the OpenTofu Registry. With this important milestone reached, it is finally time to talk about how the OpenTofu Registry and Search work under the hood and the pitfalls of running a public registry.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="the-registry-api">The Registry API<a href="https://opentofu.org/blog/building-the-opentofu-registry#the-registry-api" class="hash-link" aria-label="Direct link to The Registry API" title="Direct link to The Registry API">​</a></h2>
<p>OpenTofu and its predecessor Terraform rely on provider binaries created by the community to interact with various APIs. There are currently over 4,000 such providers in the OpenTofu Registry, enabling a wide range of integrations from cloud providers to managing your GitHub account. Anything that has an API to create some kind of resource can be integrated with OpenTofu.</p>
<p>Aside from providers, the community has also created well over 20,000 reusable modules that implement higher level functionality, such as provisioning an entire infrastructure with a cloud provider with only a few configuration options.</p>
<p>Since these providers and modules are created by the community, OpenTofu needs to know where to download them and what versions are available. This is where the Registry comes into play: it holds the information about available providers and modules, download URLs, checksums, and GPG keys for integrity verification.</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="step-1-service-discovery">Step 1: Service Discovery<a href="https://opentofu.org/blog/building-the-opentofu-registry#step-1-service-discovery" class="hash-link" aria-label="Direct link to Step 1: Service Discovery" title="Direct link to Step 1: Service Discovery">​</a></h3>
<p>For both providers and modules, OpenTofu first requests the <code>https://registry.opentofu.org/.well-known/terraform.json</code> file, which has the following content:</p>
<div class="language-json codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-json codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">"modules.v1"</span><span class="token operator" style="color:hsl(207, 82%, 66%)">:</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"/v1/modules/"</span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">"providers.v1"</span><span class="token operator" style="color:hsl(207, 82%, 66%)">:</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"/v1/providers/"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><br></span></code></pre></figure></div></div>
<p>This file lists the endpoints OpenTofu should query for information about modules and providers. For private registries there is also a third endpoint named <code>login.v1</code>, providing information about an OAuth endpoint to use for authentication. If you are interested in the details, you can read more about this protocol <a href="https://opentofu.org/docs/internals/login-protocol/" target="_blank" rel="noopener noreferrer">in the OpenTofu documentation</a>.</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="step-2-version-listing">Step 2: Version Listing<a href="https://opentofu.org/blog/building-the-opentofu-registry#step-2-version-listing" class="hash-link" aria-label="Direct link to Step 2: Version Listing" title="Direct link to Step 2: Version Listing">​</a></h3>
<p>With the endpoint information, OpenTofu can query the version listing endpoint for the desired provider or module.</p>
<ul>
<li>For providers this endpoint would be <code>/v1/providers/NAMESPACE/NAME/versions</code> (<a href="https://registry.opentofu.org/v1/providers/opentofu/random/versions" target="_blank" rel="noopener noreferrer">example</a>).</li>
<li>For modules it would be <code>/v1/modules/NAMESPACE/NAME/SYSTEM/versions</code> (<a href="https://registry.opentofu.org/v1/modules/hashicorp/consul/aws/versions" target="_blank" rel="noopener noreferrer">example</a>).</li>
</ul>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="step-3-download-info">Step 3: Download Info<a href="https://opentofu.org/blog/building-the-opentofu-registry#step-3-download-info" class="hash-link" aria-label="Direct link to Step 3: Download Info" title="Direct link to Step 3: Download Info">​</a></h3>
<p>Based on the information received, OpenTofu can request the information about the specific version, operating system and architecture.</p>
<ul>
<li>For providers, it would be located at <code>/v1/providers/NAMESPACE/NAME/VERSION/download/OS/ARCH</code> (<a href="https://registry.opentofu.org/v1/providers/opentofu/random/2.0.0/download/linux/amd64" target="_blank" rel="noopener noreferrer">example</a>).</li>
<li>For modules, it would be located at <code>/v1/modules/NAMESPACE/NAME/SYSTEM/VERSION/download</code> (<a href="https://registry.opentofu.org/v1/modules/hashicorp/consul/aws/0.11.0/download" target="_blank" rel="noopener noreferrer">example</a>).</li>
</ul>
<p>OpenTofu then downloads the provider from the supplied GitHub releases URL and verifies the checksum and signature, or clones the returned Git repository for modules.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="hosting-the-registry-for-free">Hosting the Registry (for free)<a href="https://opentofu.org/blog/building-the-opentofu-registry#hosting-the-registry-for-free" class="hash-link" aria-label="Direct link to Hosting the Registry (for free)" title="Direct link to Hosting the Registry (for free)">​</a></h2>
<p>As an open source project with a small core team working on developing OpenTofu itself, it was paramount that we kept the costs of running the Registry as low as possible both in terms of bandwidth and also in human cost. However, we also needed to make sure that the Registry had an uptime close to 100% since thousands upon thousands of developers would be left without a means to update their infrastructure if it went down.</p>
<p>Here we owe a big thanks to Cloudflare. Their very competitive pricing for <a href="https://www.cloudflare.com/developer-platform/r2/" target="_blank" rel="noopener noreferrer">R2</a> with no egress fees and their sponsorship of OpenTofu meant that we would be able to run the Registry essentially for free with no servers and scaling issues to worry about. The <a href="https://github.com/opentofu/registry" target="_blank" rel="noopener noreferrer">Registry codebase</a> (written in Go) pre-generates all possible answers of the API above and uploads the static files to an R2 bucket.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="populating-the-registry">Populating the Registry<a href="https://opentofu.org/blog/building-the-opentofu-registry#populating-the-registry" class="hash-link" aria-label="Direct link to Populating the Registry" title="Direct link to Populating the Registry">​</a></h2>
<p>Alongside the Terraform license change, HashiCorp <a href="https://registry.terraform.io/terms" target="_blank" rel="noopener noreferrer">closed the Terraform Registry</a> for software that isn't Terraform, so using it as a source of data for the OpenTofu Registry was out of the question. However, since the Terraform Registry was coupled exclusively to GitHub, it was relatively straight forward for us to use the GitHub search API to populate the Registry, if a little slow.</p>
<p>Updating the Registry, however, was a much harder problem. GitHub limits the API to ~5,000 requests per hour, which is not enough to update roughly 30,000 providers and modules in a speedy fashion, especially since some updates required multiple requests.</p>
<p>We <em>could</em> have requested provider authors to log in with their GitHub account, granting us an access token we could use for a higher rate limit, but that would have been impractical when we launched the Registry since we would have had to ask thousands of developers to log in at a time when OpenTofu wasn't even released yet.</p>
<p>The solution came by the way of the GitHub RSS feeds, which are not rate limited. The releases RSS located at <code>http://github.com/USERNAME/REPO/releases.atom</code> always contains the last 5 releases, which is sufficient if we only need to add the latest versions as it is unlikely that a provider or module would have more than 5 releases within an hour. For modules, we needed to query the tags instead of the releases, which was even easier because the <code>git ls-remote</code> command gave us all this information and was also not rate limited. (You are going to keep it that way, right, GitHub?)</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="the-submission-process">The submission process<a href="https://opentofu.org/blog/building-the-opentofu-registry#the-submission-process" class="hash-link" aria-label="Direct link to The submission process" title="Direct link to The submission process">​</a></h3>
<p>Since we didn't need to ask provider and module authors for their credentials using OAuth, we were able to create a simple submission process that anyone with a GitHub account could use.</p>
<p>While anyone could submit a provider or a module, we still needed provider authors to submit their GPG keys so their binaries could be verified. Instead of asking for OAuth logins, we again decided to use the GitHub API in a creative way. In order to submit a GPG key for a provider, the author needed to set their organization membership to public for the repository of the provider and then submit a GitHub issue. We would verify their membership in the provider organization and process their GPG keys.</p>
<p>Having the submission process being as simple as opening a GitHub issue turned out to be quite popular. To date, the community has opened almost 1,000 pull requests and issues on the Registry repository. It also meant that provider and module authors working for larger organizations did not need to expend any organizational capacity to sign up for an OpenTofu account, resulting in quite a few high profile providers adding their GPG key.</p>
<div class="flex flex-col py-2 px-3 not-prose border gap-1 [&amp;+&amp;]:mt-3 [&amp;_a:hover]:text-gray-900 dark:[&amp;_a:hover]:text-gray-50 [&amp;_a>code]:font-bold [&amp;_code]:text-base [&amp;_code]:px-1.5 [&amp;_a]:underline [&amp;_p]:mb-2 bg-sky-100 border-sky-300 text-sky-800 dark:bg-sky-950 dark:border-sky-700 dark:text-sky-100" role="alert"><div class="flex gap-3 font-bold"><span class="flex w-4 fill-current [&amp;>svg]:w-full" aria-hidden="true"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>Learn more</div><div class="leading-relaxed"><p>Do you want to learn more about the early days of the OpenTofu Registry? James and Arel from the OpenTofu team <a href="https://www.youtube.com/watch?v=iJUcOBwPxVU" target="_blank" rel="noopener noreferrer">held a talk about this topic at the OpenTofu Day at Kubecon 2024</a>.</p></div></div>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="building-a-user-interface">Building a user interface<a href="https://opentofu.org/blog/building-the-opentofu-registry#building-a-user-interface" class="hash-link" aria-label="Direct link to Building a user interface" title="Direct link to Building a user interface">​</a></h2>
<p>After working on the Registry and taking a few months pause for some much-needed work on OpenTofu itself, we returned to building a search and documentation reading interface. As we would soon learn, this was a larger task and resulted in three times the amount of code needing to be written.</p>
<p><img loading="lazy" alt="A screenshot of the OpenTofu Registry Search" src="https://opentofu.org/assets/images/registry-ui-723067c7ca2d4636fb23928b1dc79b92.png" width="1894" height="1086" class="img_ev3q"></p>
<p>As before, we chose an architecture that would generate static files. Early on we had to make a decision between simply generating static HTML files or using a Single Page Application and load the data from an API. We chose the latter because we were concerned that a layout change would require a complete regeneration of all files, which would be cost-prohibitive to upload again and again.</p>
<p>Having made this decision we set out to build a backend and a frontend component, the former being responsible for producing the data the latter would consume. We built <a href="https://github.com/opentofu/libregistry" target="_blank" rel="noopener noreferrer">libregistry</a>, a standardized Go library that would make it easier to access the metadata stored in the Registry repository and provide a useful abstraction layer on top of GitHub and the various creative API integrations we built to fetch the data.</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="pre-processing-the-documentation">Pre-processing the documentation<a href="https://opentofu.org/blog/building-the-opentofu-registry#pre-processing-the-documentation" class="hash-link" aria-label="Direct link to Pre-processing the documentation" title="Direct link to Pre-processing the documentation">​</a></h3>
<p>While the Registry always regenerates all API responses from the raw metadata, this approach was not feasible for the documentation due to the sheer volume of data we needed to process. Not only would we have to produce documentation responses for tens of thousands of providers and modules, some of them also had several hundred versions, each of which needed their own copy of the documentation stored.</p>
<p>We decided that we would process the data from the source repositories directly into an R2 bucket without storing any intermediate data. This approach came with its own problems. While the Registry could make use of git to track changes in the intermediate data, we needed to make sure that our uploads to the R2 bucket were as close to atomic as possible so no partial uploads are left behind. While we have implemented a <a href="https://github.com/opentofu/registry-ui/tree/4adefb41539f14e78e84479e45c69e3f8a505b89/backend/internal/indexstorage/bufferedstorage" target="_blank" rel="noopener noreferrer">partial solution that can continue an upload</a>, this still remains one of the unsolved issues with the Registry.</p>
<p>In order to simplify the necessary frontend logic for displaying the documentation, the backend's main job is to rename and move each of the documentation files into their standardized place. There is no formalized description on how providers can store their documentation, so the logic for extracting this information is <a href="https://github.com/opentofu/registry-ui/blob/4adefb41539f14e78e84479e45c69e3f8a505b89/backend/internal/providerindex/providerdocsource/scrape.go#L159-L190" target="_blank" rel="noopener noreferrer">only empirically known</a>. We needed several iterations to work around various bugs as we expanded the number of repositories we ingested and discovered newer and newer edge cases.</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="module-schemas">Module schemas<a href="https://opentofu.org/blog/building-the-opentofu-registry#module-schemas" class="hash-link" aria-label="Direct link to Module schemas" title="Direct link to Module schemas">​</a></h3>
<p>While providers typically have their own, explicit documentation, often generated by tools like <a href="https://terraform-docs.io/" target="_blank" rel="noopener noreferrer">terraform-docs</a>, modules don't have such information readily available. This makes it difficult to generate information about their inputs, outputs and dependencies.</p>
<p>HashiCorp published <a href="https://github.com/hashicorp/terraform-schema" target="_blank" rel="noopener noreferrer">terraform-schema</a> for extracting this information, duplicating some of the module parsing logic from Terraform. However, we decided that maintaining duplicated codebases would likely cause a maintenance issue down the line and implemented this functionality directly into OpenTofu. This patch currently <a href="https://github.com/opentofu/opentofu/tree/experiment/json_config_dump" target="_blank" rel="noopener noreferrer">lives on a branch</a>, but will be integrated into the main branch as an experimental feature at a later date.</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="licenses">Licenses<a href="https://opentofu.org/blog/building-the-opentofu-registry#licenses" class="hash-link" aria-label="Direct link to Licenses" title="Direct link to Licenses">​</a></h3>
<p>During the ingestion process we also needed to concern ourselves with licenses: as we were unsure under what legal standard such a documentation dataset would fall, we deliberately chose a <a href="https://github.com/opentofu/registry-ui/blob/4adefb41539f14e78e84479e45c69e3f8a505b89/licenses.json" target="_blank" rel="noopener noreferrer">restricted set of licenses</a> that we would accept into the Registry documentation. We performed automatic license detection on each provider and module repository to avoid ingesting content under potentially problematic licenses.</p>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="the-opentofu-docs-api-and-how-you-can-use-it">The OpenTofu Docs API (and how you can use it)<a href="https://opentofu.org/blog/building-the-opentofu-registry#the-opentofu-docs-api-and-how-you-can-use-it" class="hash-link" aria-label="Direct link to The OpenTofu Docs API (and how you can use it)" title="Direct link to The OpenTofu Docs API (and how you can use it)">​</a></h3>
<p>Doing all this work on the backend and splitting the display logic from the data also had an unintended but very welcomed side effect: we were able to offer <a href="https://api.opentofu.org/" target="_blank" rel="noopener noreferrer">an API for provider and module documentation</a>, which would come in handy as just a few weeks later <a href="https://youtrack.jetbrains.com/issue/IJPL-157423/Support-for-OpenTofu-in-Terraform-and-HCL-Plugin#focus=Comments-27-10245678.0-0" target="_blank" rel="noopener noreferrer">Jetbrains requested just such an API for their OpenTofu integration</a>.</p>
<p>The backend produces the dataset in this format and is easily runnable locally from the <a href="https://github.com/opentofu/registry-ui" target="_blank" rel="noopener noreferrer">registry-ui</a> repository, while the <a href="https://api.opentofu.org/" target="_blank" rel="noopener noreferrer">public API</a> is available for anyone to build integrations with. We even made sure to include the correct <a href="https://en.wikipedia.org/wiki/Cross-Origin_Resource_Sharing" target="_blank" rel="noopener noreferrer">CORS headers</a> if you would like to build a browser-only integration. If you build something cool with it, let us know!</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="search">Search<a href="https://opentofu.org/blog/building-the-opentofu-registry#search" class="hash-link" aria-label="Direct link to Search" title="Direct link to Search">​</a></h2>
<p>As we were building the backend, one issue was constantly on our minds: how do we make such a vast data set searchable? We hoped that it would be possible to simply generate a search index and let the client JavaScript deal with the entire search problem. As we were looking at <a href="https://lunrjs.com/" target="_blank" rel="noopener noreferrer">lunr.js</a>, a robust and mature library for search, it quickly became apparent that this path would be entirely unfeasible. Even with a limited data set, the download size of the search index quickly ballooned to several hundred megabytes, which is not exactly ideal for a snappy search functionality not to mention really upsetting to people with data caps.</p>
<p>Not wanting to run our own database server or involve any more service dependencies, we looked at <a href="https://developers.cloudflare.com/d1/" target="_blank" rel="noopener noreferrer">Cloudflare's D1</a>, a SQLite database service and a <a href="https://workers.cloudflare.com/" target="_blank" rel="noopener noreferrer">worker</a> to handle search queries. While it initially looked promising, we discovered that we would have to submit all updates in a single HTTP request in order to run them in a transaction.</p>
<p>It would have been possible to work around it and still perform atomic search index updates, but we ended up using <a href="https://neon.tech/" target="_blank" rel="noopener noreferrer">Neon</a>, a database-as-a-service offering, instead. They don't explicitly sponsor OpenTofu, but their free tier was comfortably enough for our search index and the next tier was also quite affordable. Their tight integration with Cloudflare was also a very welcome addition.</p>
<p>To query the database hosted at Neon, we <a href="https://github.com/opentofu/registry-ui/tree/4adefb41539f14e78e84479e45c69e3f8a505b89/search" target="_blank" rel="noopener noreferrer">created a Cloudflare worker</a>. This worker ended up handling all requests to <code>api.opentofu.org</code>, forwarding the static requests to R2 and handling the search queries itself.</p>
<p>The backend would prepare a line-delimited JSON (ndjson) file with a data feed at <a href="https://api.opentofu.org/registry/docs/search.ndjson" target="_blank" rel="noopener noreferrer">https://api.opentofu.org/registry/docs/search.ndjson</a>, containing all recent updates to the search index that the worker could ingest and fill into the database.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="where-do-we-go-from-here">Where do we go from here?<a href="https://opentofu.org/blog/building-the-opentofu-registry#where-do-we-go-from-here" class="hash-link" aria-label="Direct link to Where do we go from here?" title="Direct link to Where do we go from here?">​</a></h2>
<p>The OpenTofu Registry Search is currently in beta, indicating that not everything is working yet. As we are expanding the amount of providers and modules indexed, we will certainly discover more edge cases that need to be fixed.</p>
<p>The libregistry library also duplicates a lot of the functionality present in the registry codebase as well. We want to deduplicate this functionality, both for long-term maintenance and because libregistry would make it easier for people to run their own mirror or even independent copy of the Registry.</p>
<p>During this process your feedback is invaluable for prioritization. If you find a bug or have a use case we haven't considered, please use <a href="https://github.com/opentofu/registry-ui/issues/new/choose" target="_blank" rel="noopener noreferrer">GitHub issues</a> to let us know.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OpenTofu 1.8.0 is out with Early Evaluation, Provider Mocking, and a Coder-Friendly Future]]></title>
            <link>https://opentofu.org/blog/opentofu-1-8-0</link>
            <guid>https://opentofu.org/blog/opentofu-1-8-0</guid>
            <pubDate>Mon, 29 Jul 2024 00:00:00 GMT</pubDate>
            <description><![CDATA[OpenTofu 1.8.0 is now available with early variable/locals evaluation, provider mocking for tests, and a future that makes every-day Tofu code a lot simpler.]]></description>
            <content:encoded><![CDATA[<p>Since the <a href="https://opentofu.org/blog/opentofu-1-7-0/">1.7 release</a>, the OpenTofu community and core team have been hard at work on much-requested features, making <code>.tf</code> code easier to write, reducing unnecessary boilerplate, improving performance, and more. We are happy to announce the <a href="https://github.com/opentofu/opentofu/releases/tag/v1.8.0" target="_blank" rel="noopener noreferrer">immediate availability of OpenTofu 1.8</a> with the following main features:</p>
<ul>
<li><a href="https://opentofu.org/docs/intro/whats-new/#early-variablelocals-evaluation">You can now use variables and locals in places</a> that were not previously available, such as module sources, backend configuration and state encryption. Being able to assign variables more dynamically will eliminate code duplication and boilerplate code, making projects easier to maintain. However, we are not stopping there: future releases will see <a href="https://github.com/opentofu/opentofu/issues/300" target="_blank" rel="noopener noreferrer">dynamic provider configuration assignments</a> and more.</li>
<li>Since Terraform doesn't support these new language features, <a href="https://opentofu.org/docs/intro/whats-new/#override-files-for-opentofu-keeping-compatibility">OpenTofu now supports the <code>.tofu</code> file extension</a>. When a file with the <code>.tofu</code> extension is present, OpenTofu will ignore the identically named <code>.tf</code> file. Using this new file extension, module authors can use the new features of OpenTofu and still keep older code around for compatibility.</li>
<li>You can now use <a href="https://opentofu.org/docs/intro/whats-new/#provider-mocking-in-tofu-test">provider mocking</a> as well as <a href="https://opentofu.org/docs/intro/whats-new/#resource-overrides-in-tofu-test">resource overrides</a> with <code>tofu test</code>. This allows for more flexible testing similar to traditional software testing methods.</li>
</ul>
<p>You can find the full list of improvements and changes on the <a href="https://opentofu.org/docs/v1.8/intro/whats-new/">What's new in OpenTofu 1.8?</a> page.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="growth-continues-30-increase-in-registry-traffic">Growth continues: ~30% increase in registry traffic<a href="https://opentofu.org/blog/opentofu-1-8-0#growth-continues-30-increase-in-registry-traffic" class="hash-link" aria-label="Direct link to Growth continues: ~30% increase in registry traffic" title="Direct link to Growth continues: ~30% increase in registry traffic">​</a></h2>
<p>While we don't believe in tracking our users and OpenTofu does not have phone-home telemetry, we can observe a trajectory based on registry usage. In our <a href="https://opentofu.org/blog/opentofu-1-7-0/">last release post</a> 3 months ago we recorded a peak of roughly 1.4 million daily requests to the registry. We are happy to report that this number has increased by roughly 30% to almost 1.8 million peak daily requests.</p>
<p><img loading="lazy" alt="A graph showing the OpenTofu registry requests per day." src="https://opentofu.org/assets/images/opentofu-registry-july-2024-5e1bb32e861e4a5cd427261cecf2a079.svg" width="1542" height="620" class="img_ev3q"></p>
<p>As before, the OpenTofu community is very active in reporting and voting on issues, fixing bugs, and helping out with testing. The number of GitHub stars grew by ~10% to almost 22.000, the <a href="https://github.com/opentofu/opentofu/issues/1496" target="_blank" rel="noopener noreferrer">top-voted issues</a> received hundreds of votes and quite a few comments in the discussions. This release has also seen significant contributions from outside the core team, ranging from small fixes to large performance overhaul PRs. In total, over 100 issues and over 150 pull requests were opened since the last release. 26 people contributed to this release on the main repository alone, with several significant contributions added to other repositories as well.</p>
<p>Finally, we'd like to direct your attention to <a href="https://awesome-opentofu.com/" target="_blank" rel="noopener noreferrer">Awesome OpenTofu</a>, a community page containing a host of tools, platforms, registry implementations and learning material for OpenTofu.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="better-documentation-for-the-future-the-new-rfc-process">Better documentation for the future: the new RFC process<a href="https://opentofu.org/blog/opentofu-1-8-0#better-documentation-for-the-future-the-new-rfc-process" class="hash-link" aria-label="Direct link to Better documentation for the future: the new RFC process" title="Direct link to Better documentation for the future: the new RFC process">​</a></h2>
<p>As the community kept working hand-in-hand with the core team it became clear that our previous RFC process based on GitHub Issues wasn't detailed enough. The linear nature of issue comments didn't encourage discussing specific parts of an RFC and the RFCs themselves did not contain enough context for someone in a few months or years to fully understand why the change was necessary.</p>
<p>Our <a href="https://github.com/opentofu/opentofu/tree/main/rfc" target="_blank" rel="noopener noreferrer">new pull request-based RFC process</a> fills this gap by using PR reviews to discuss parts of a document and the document itself encourages creating a historical record. We have trialled this process during the development of the <a href="https://github.com/opentofu/opentofu/blob/main/rfc/20240513-static-evaluation.md" target="_blank" rel="noopener noreferrer">early (static) evaluation feature</a> and also the upcoming <a href="https://github.com/opentofu/opentofu/blob/main/rfc/20240513-static-evaluation-providers.md" target="_blank" rel="noopener noreferrer">dynamic provider assignment</a> functionality. We hope that these documents will provide a better view into the new features coming to OpenTofu and also help create a historical record on why engineering decision were made the way they were.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="coming-soon-the-opentofu-registry-ui">Coming soon: the OpenTofu Registry UI<a href="https://opentofu.org/blog/opentofu-1-8-0#coming-soon-the-opentofu-registry-ui" class="hash-link" aria-label="Direct link to Coming soon: the OpenTofu Registry UI" title="Direct link to Coming soon: the OpenTofu Registry UI">​</a></h2>
<p>In parallel to this release, we have been hard at work on a web-based user interface for the OpenTofu Registry. This user interface will allow you to browse and search for providers, resources and modules and read their documentation in a convenient format. We are aiming to release this user interface in the next few weeks.</p>
<p><img loading="lazy" alt="A preview screenshot of the OpenTofu Registry UI" src="https://opentofu.org/assets/images/opentofu-registry-preview-130128cdbfafd1448637e9c74071db8e.png" width="2334" height="1330" class="img_ev3q"></p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="fulfilling-promises-our-first-go-libraries">Fulfilling promises: our first Go libraries<a href="https://opentofu.org/blog/opentofu-1-8-0#fulfilling-promises-our-first-go-libraries" class="hash-link" aria-label="Direct link to Fulfilling promises: our first Go libraries" title="Direct link to Fulfilling promises: our first Go libraries">​</a></h2>
<p>OpenTofu was founded on the principle of openness and modularity. While it is not always easy to modularize a codebase with a long history, we have released our first Go libraries for interoperability.</p>
<p><a href="https://github.com/opentofu/tofudl" target="_blank" rel="noopener noreferrer">TofuDL</a> encodes the process of fetching the latest version of OpenTofu, verifying the signature and extracting the binary for local use into an easy-to-use Go library. Tool authors can use this library to cut down on the complexity of downloading the Tofu binary when needed. Furthermore, this library contains a full release mirroring tool, allowing you to build a release server with OpenTofu releases for air-gapped infrastructure that TofuDL-based tools can use to obtain the mirrored binaries.</p>
<p>The currently experimental <a href="https://github.com/opentofu/libregistry" target="_blank" rel="noopener noreferrer">libregistry</a> provides structured access to the data stored in the OpenTofu registry using the metadata API. In the future, we will transition the processes currently written for GitHub Actions into this library, allowing you to execute all registry processes independently of GitHub. You can use this library as a basis for writing your own registry, although the batteries are definitely not included.</p>
<p>Please give these libraries a go (pun totally intended) and let us know what functionality you would like to see in them.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="the-future-more-dynamic-functionality-even-more-community-focussed-development">The future: more dynamic functionality, even more community-focussed development<a href="https://opentofu.org/blog/opentofu-1-8-0#the-future-more-dynamic-functionality-even-more-community-focussed-development" class="hash-link" aria-label="Direct link to The future: more dynamic functionality, even more community-focussed development" title="Direct link to The future: more dynamic functionality, even more community-focussed development">​</a></h2>
<p>Ever since we created our <a href="https://github.com/opentofu/opentofu/issues/1496" target="_blank" rel="noopener noreferrer">top-ranking issues</a> list, new votes from the community started pouring in, giving us a strong signal on where you want us to take OpenTofu. By a large margin, the top-requested issue was one we partly solved in this release by introducing early evaluation for variables and locals. However, this is only the first step. As you helped us test the early alpha and beta of this release, one of the most commonly asked questions was: <em>“When can I use early evaluation to dynamically configure providers?”</em></p>
<p>The top-voted enhancement reflects a similar sentiment. In 1.9 and beyond, we aim to bring you dynamic provider assignments and more early-evaluation features, which let you cut down on the unnecessary code repetition even further. If you are interested in this topic, give the <a href="https://github.com/opentofu/opentofu/blob/main/rfc/20240513-static-evaluation-providers.md" target="_blank" rel="noopener noreferrer">corresponding RFC a read</a>.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="an-ask-for-help-gpg-keys-for-providers">An ask for help: GPG keys for providers<a href="https://opentofu.org/blog/opentofu-1-8-0#an-ask-for-help-gpg-keys-for-providers" class="hash-link" aria-label="Direct link to An ask for help: GPG keys for providers" title="Direct link to An ask for help: GPG keys for providers">​</a></h2>
<p>Finally, we have a favor to ask. The OpenTofu registry currently contains GPG signing keys only for a small number of providers as these keys are not publicly available on GitHub. If you are a provider author, <a href="https://github.com/opentofu/registry/issues/new/choose" target="_blank" rel="noopener noreferrer">please submit your signing key here</a>. It takes only a few minutes and does not require you to sign any legal documents or grant us access to your GitHub organization. If you are an OpenTofu user and you see that your providers are not signed, please let your provider author know that they can submit their keys and help secure the OpenTofu ecosystem.</p>
<p>You can identify a missing signing key by running <code>tofu init</code> and keeping an eye out for the following message:</p>
<blockquote>
<p>Signature validation was skipped due to the registry not containing GPG keys for this provider</p>
</blockquote>
<p>Thank you for your help!</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Get ready for OpenTofu Beta 1.8.0]]></title>
            <link>https://opentofu.org/blog/opentofu-1-8-0-beta1</link>
            <guid>https://opentofu.org/blog/opentofu-1-8-0-beta1</guid>
            <pubDate>Tue, 09 Jul 2024 00:00:00 GMT</pubDate>
            <description><![CDATA[Hey there, OpenTofu community! We've been working hard to refine the 1.8.0-alpha1 with your feedback! A few rough edges have been polished and a few new features have been added.]]></description>
            <content:encoded><![CDATA[<p>Hey there, OpenTofu community! We've been working hard to refine the <a href="https://opentofu.org/blog/help-us-test-opentofu-1-8-0-alpha1/">1.8.0-alpha1</a> with your feedback! A few rough edges have been polished and a few new features have been added.</p>
<p>If you have a <strong>non-production</strong> setup that you would be willing to test any of the new features on, please give it a try and give us <a href="https://github.com/opentofu/opentofu/issues/new/choose" target="_blank" rel="noopener noreferrer">feedback using a GitHub issue</a>, even if it's just telling us that everything went well.</p>
<p>This blog post will go over how to download the new preview release and expand on the features presented in the <a href="https://opentofu.org/blog/help-us-test-opentofu-1-8-0-alpha1/">1.8.0-alpha1 blog post</a>.</p>
<div class="flex flex-col py-2 px-3 not-prose border gap-1 [&amp;+&amp;]:mt-3 [&amp;_a:hover]:text-gray-900 dark:[&amp;_a:hover]:text-gray-50 [&amp;_a>code]:font-bold [&amp;_code]:text-base [&amp;_code]:px-1.5 [&amp;_a]:underline [&amp;_p]:mb-2 bg-yellow-100 border-yellow-500 text-yellow-800 dark:bg-yellow-950 dark:border-yellow-700 dark:text-yellow-100" role="alert"><div class="flex gap-3 font-bold"><span class="flex w-4 fill-current [&amp;>svg]:w-full" aria-hidden="true"><svg viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"></path></svg></span>Warning</div><div class="leading-relaxed"><p>Do not test this release on a production project! It is not a stable release!</p></div></div>
<div class="flex flex-col py-2 px-3 not-prose border gap-1 [&amp;+&amp;]:mt-3 [&amp;_a:hover]:text-gray-900 dark:[&amp;_a:hover]:text-gray-50 [&amp;_a>code]:font-bold [&amp;_code]:text-base [&amp;_code]:px-1.5 [&amp;_a]:underline [&amp;_p]:mb-2 bg-sky-100 border-sky-300 text-sky-800 dark:bg-sky-950 dark:border-sky-700 dark:text-sky-100" role="alert"><div class="flex gap-3 font-bold"><span class="flex w-4 fill-current [&amp;>svg]:w-full" aria-hidden="true"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>Note</div><div class="leading-relaxed"><p>On 2024/07/11, 1.8.0-beta2 was released to address issues present in 1.8.0-beta1.</p></div></div>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="downloading-the-beta-release">Downloading the beta release<a href="https://opentofu.org/blog/opentofu-1-8-0-beta1#downloading-the-beta-release" class="hash-link" aria-label="Direct link to Downloading the beta release" title="Direct link to Downloading the beta release">​</a></h2>
<p>The beta release is available exclusively from the <a href="https://github.com/opentofu/opentofu/releases/tag/v1.8.0-beta2" target="_blank" rel="noopener noreferrer">GitHub Releases page</a>. Please select the appropriate file for your platform. Here are some quick links:</p>
<table><thead><tr><th>Platform/Device</th><th>Download link</th></tr></thead><tbody><tr><td><strong>Desktop Windows computer</strong><br>(64-bit)</td><td><a href="https://github.com/opentofu/opentofu/releases/download/v1.8.0-beta2/tofu_1.8.0-beta2_windows_amd64.zip" target="_blank" rel="noopener noreferrer">tofu_1.8.0-beta2_windows_amd64.zip</a></td></tr><tr><td><strong>MacOS</strong><br>(Macbook M1 or higher; ARM64)</td><td><a href="https://github.com/opentofu/opentofu/releases/download/v1.8.0-beta2/tofu_1.8.0-beta2_darwin_arm64.tar.gz" target="_blank" rel="noopener noreferrer">tofu_1.8.0-beta2_darwin_arm64.tar.gz</a></td></tr><tr><td><strong>MacOS</strong><br>(Macbook pre-M1; AMD64)</td><td><a href="https://github.com/opentofu/opentofu/releases/download/v1.8.0-beta2/tofu_1.8.0-beta2_darwin_amd64.tar.gz" target="_blank" rel="noopener noreferrer">tofu_1.8.0-beta2_darwin_amd64.tar.gz</a></td></tr><tr><td><strong>Intel/AMD Linux computer or server</strong><br>(AMD64)</td><td><a href="https://github.com/opentofu/opentofu/releases/download/v1.8.0-beta2/tofu_1.8.0-beta2_linux_amd64.tar.gz" target="_blank" rel="noopener noreferrer">tofu_1.8.0-beta2_linux_amd64.tar.gz</a></td></tr><tr><td><strong>ARM-based Linux computer<br>or<br>Raspberry Pi 3 or higher</strong><br>(ARM64)</td><td><a href="https://github.com/opentofu/opentofu/releases/download/v1.8.0-beta2/tofu_1.8.0-beta2_linux_arm64.tar.gz" target="_blank" rel="noopener noreferrer">tofu_1.8.0-beta2_linux_arm64.tar.gz</a></td></tr></tbody></table>
<p>For the releases above, please unpack the archive and you should find the <code>tofu</code> binary inside. You can also use the <a href="https://opentofu.org/docs/intro/install/standalone/" target="_blank" rel="noopener noreferrer">standalone installer</a> to download the release with signature verification.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="provider-mocking-in-tofu-test">Provider mocking in <code>tofu test</code><a href="https://opentofu.org/blog/opentofu-1-8-0-beta1#provider-mocking-in-tofu-test" class="hash-link" aria-label="Direct link to provider-mocking-in-tofu-test" title="Direct link to provider-mocking-in-tofu-test">​</a></h2>
<p>Building on the existing ability to override specific data sources, resources, and module calls, <code>tofu test</code> now supports mocking entire provider definitions. This new feature allows you to automatically generate mock values for resources and data sources on a per-provider basis. As an example, consider the following code that spins up an m6i.2xlarge instance on AWS:</p>
<div class="language-hcl codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-hcl codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token keyword" style="color:hsl(286, 60%, 67%)">provider</span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)"> "aws" </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">region</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"us-east-1"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token keyword" style="color:hsl(286, 60%, 67%)">data </span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)">"aws_ami"</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"ubuntu"</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">most_recent</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token boolean" style="color:hsl(29, 54%, 61%)">true</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token keyword" style="color:hsl(286, 60%, 67%)">filter</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      </span><span class="token property" style="color:hsl(355, 65%, 65%)">name</span><span class="token plain">   </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"name"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      </span><span class="token property" style="color:hsl(355, 65%, 65%)">values</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">[</span><span class="token string" style="color:hsl(95, 38%, 62%)">"ubuntu/images/hvm-ssd/ubuntu-jammy-24.04-amd64-server-*"</span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">owners</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">[</span><span class="token string" style="color:hsl(95, 38%, 62%)">"099720109477"</span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token keyword" style="color:hsl(286, 60%, 67%)">resource </span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)">"aws_instance"</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"web"</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">ami</span><span class="token plain">           </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> data.aws_ami.ubuntu.id</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">instance_type</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"m6i.2xlarge"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><br></span></code></pre></figure></div></div>
<p>Instead of querying the AMI ID and spinning up the instance, we can write test code as follows:</p>
<div class="language-hcl codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-hcl codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token comment" style="color:hsl(220, 10%, 40%)">// This block will prevent OpenTofu from configuring aws provider.</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token comment" style="color:hsl(220, 10%, 40%)">// All provider's resources and data sources will be mocked.</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">mock_</span><span class="token keyword" style="color:hsl(286, 60%, 67%)">provider</span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)"> "aws" </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  mock_data </span><span class="token string" style="color:hsl(95, 38%, 62%)">"aws_ami"</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">defaults</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      </span><span class="token property" style="color:hsl(355, 65%, 65%)">id</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"ami-12345"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">run </span><span class="token string" style="color:hsl(95, 38%, 62%)">"test"</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token keyword" style="color:hsl(286, 60%, 67%)">assert</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">condition</span><span class="token plain">     </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> aws_instance.web.ami </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"ami-12345"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">error_message</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"Incorrect AMI ID passed to aws_instance.web: </span><span class="token string interpolation punctuation" style="color:hsl(220, 14%, 71%)">$</span><span class="token string interpolation punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token string interpolation" style="color:hsl(95, 38%, 62%)">aws_instance</span><span class="token string interpolation punctuation" style="color:hsl(220, 14%, 71%)">.</span><span class="token string interpolation" style="color:hsl(95, 38%, 62%)">web</span><span class="token string interpolation punctuation" style="color:hsl(220, 14%, 71%)">.</span><span class="token string interpolation" style="color:hsl(95, 38%, 62%)">ami</span><span class="token string interpolation punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token string" style="color:hsl(95, 38%, 62%)">"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><br></span></code></pre></figure></div></div>
<p>While this will not fully test the entire provisioning, it will highlight errors that may be caused by incorrectly connecting resources together without the need for an actual AWS account.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="resource-overrides-in-tofu-test">Resource overrides in <code>tofu test</code><a href="https://opentofu.org/blog/opentofu-1-8-0-beta1#resource-overrides-in-tofu-test" class="hash-link" aria-label="Direct link to resource-overrides-in-tofu-test" title="Direct link to resource-overrides-in-tofu-test">​</a></h2>
<p>First introduced in OpenTofu 1.8.0-alpha1, you can now override resources, data sources and entire modules from your tests, allowing you to create similar behavior to mocks in traditional software testing. As an example, consider the following code that spins up an <code>m6i.2xlarge</code> instance on AWS:</p>
<div class="language-hcl codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-hcl codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token keyword" style="color:hsl(286, 60%, 67%)">provider</span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)"> "aws" </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">region</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"us-east-1"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token keyword" style="color:hsl(286, 60%, 67%)">data </span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)">"aws_ami"</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"ubuntu"</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">most_recent</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token boolean" style="color:hsl(29, 54%, 61%)">true</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token keyword" style="color:hsl(286, 60%, 67%)">filter</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      </span><span class="token property" style="color:hsl(355, 65%, 65%)">name</span><span class="token plain">   </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"name"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      </span><span class="token property" style="color:hsl(355, 65%, 65%)">values</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">[</span><span class="token string" style="color:hsl(95, 38%, 62%)">"ubuntu/images/hvm-ssd/ubuntu-jammy-24.04-amd64-server-*"</span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">owners</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">[</span><span class="token string" style="color:hsl(95, 38%, 62%)">"099720109477"</span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token keyword" style="color:hsl(286, 60%, 67%)">resource </span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)">"aws_instance"</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"web"</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">ami</span><span class="token plain">           </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> data.aws_ami.ubuntu.id</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">instance_type</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"m6i.2xlarge"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><br></span></code></pre></figure></div></div>
<p>Instead of querying the AMI ID and spinning up the instance, we can write test code as follows:</p>
<div class="language-hcl codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-hcl codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token keyword" style="color:hsl(286, 60%, 67%)">provider</span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)"> "aws" </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">access_key</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"foo"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">secret_key</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"bar"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">skip_credentials_validation</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token boolean" style="color:hsl(29, 54%, 61%)">true</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">skip_region_validation</span><span class="token plain">      </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token boolean" style="color:hsl(29, 54%, 61%)">true</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">skip_metadata_api_check</span><span class="token plain">     </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token boolean" style="color:hsl(29, 54%, 61%)">true</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">skip_requesting_account_id</span><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token boolean" style="color:hsl(29, 54%, 61%)">true</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token comment" style="color:hsl(220, 10%, 40%)"># This block disables refreshing the aws_ami.ubuntu data source</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token comment" style="color:hsl(220, 10%, 40%)"># and lets you manually specify the values:</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token keyword" style="color:hsl(286, 60%, 67%)">override_data</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">target</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> data.aws_ami.ubuntu</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">values</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">id</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"ami-12345"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">run </span><span class="token string" style="color:hsl(95, 38%, 62%)">"test"</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token comment" style="color:hsl(220, 10%, 40%)"># This block disables provisioning the aws_instance.web resource:</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token keyword" style="color:hsl(286, 60%, 67%)">override_resource</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">target</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> aws_instance.web</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">values</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      </span><span class="token comment" style="color:hsl(220, 10%, 40%)"># You can add values here.</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token keyword" style="color:hsl(286, 60%, 67%)">assert</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">condition</span><span class="token plain">     </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> aws_instance.web.ami </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"ami-12345"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">error_message</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"Incorrect AMI ID passed to aws_instance.web: </span><span class="token string interpolation punctuation" style="color:hsl(220, 14%, 71%)">$</span><span class="token string interpolation punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token string interpolation" style="color:hsl(95, 38%, 62%)">aws_instance</span><span class="token string interpolation punctuation" style="color:hsl(220, 14%, 71%)">.</span><span class="token string interpolation" style="color:hsl(95, 38%, 62%)">web</span><span class="token string interpolation punctuation" style="color:hsl(220, 14%, 71%)">.</span><span class="token string interpolation" style="color:hsl(95, 38%, 62%)">ami</span><span class="token string interpolation punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token string" style="color:hsl(95, 38%, 62%)">"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><br></span></code></pre></figure></div></div>
<p>While this will not fully test the entire provisioning, it will highlight errors that may be caused by incorrectly connecting resources together without the need for an actual AWS account. Similarly, you can use <code>override_module</code> to override an entire module.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="early-variablelocals-evaluation">Early variable/locals evaluation<a href="https://opentofu.org/blog/opentofu-1-8-0-beta1#early-variablelocals-evaluation" class="hash-link" aria-label="Direct link to Early variable/locals evaluation" title="Direct link to Early variable/locals evaluation">​</a></h2>
<p>Introduced in OpenTofu 1.8.0-alpha1, this feature lets you use variables and locals for <strong>backends</strong>, <strong>module sources</strong> and <strong>encryption configuration</strong> as long as they are not dependent on resources, data sources or module outputs. This works even if a local is referencing a variable, for example. This is only the first in a series of improvements that will make the .tf code more flexible with more improvements coming in future releases.</p>
<p>The <code>tofu init</code> command will now consume your <code>.tfvars</code> file and let you specify variables using the <code>-var</code> and <code>-var-file</code> options. Please note that this alpha release will <em>not</em> prompt you for missing variables, which is a feature we will add later. Note, that <code>tofu init</code> will fail if it is missing variables needed for static evaluation.</p>
<p>For example, if you wanted to use the same configuration for your S3 backend and your AWS provider, you can now do this:</p>
<div class="language-hcl codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-hcl codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token keyword" style="color:hsl(286, 60%, 67%)">variable</span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)"> "aws_region" </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">default</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"us-east-1"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token keyword" style="color:hsl(286, 60%, 67%)">terraform</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token keyword" style="color:hsl(286, 60%, 67%)">backend</span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)"> "s3" </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">region</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> var.aws_region</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token keyword" style="color:hsl(286, 60%, 67%)">provider</span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)"> "aws" </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">region</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> var.aws_region</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><br></span></code></pre></figure></div></div>
<p>You can also use this to manage module versions with both registry references and git URLs.</p>
<div class="language-hcl codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-hcl codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token keyword" style="color:hsl(286, 60%, 67%)">locals</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">aws_module_version</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"5.6.1"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token keyword" style="color:hsl(286, 60%, 67%)">module</span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)"> "webserver" </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">source</span><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"terraform-aws-modules/ec2-instance/aws"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">version</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> local.aws_module_version</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token comment" style="color:hsl(220, 10%, 40%)">// Other ec2_instance options</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token keyword" style="color:hsl(286, 60%, 67%)">module</span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)"> "db" </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">source</span><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"https://github.com/terraform-aws-modules/terraform-aws-ec2-instance?ref=v</span><span class="token string interpolation punctuation" style="color:hsl(220, 14%, 71%)">$</span><span class="token string interpolation punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token string interpolation keyword" style="color:hsl(286, 60%, 67%)">local</span><span class="token string interpolation punctuation" style="color:hsl(220, 14%, 71%)">.</span><span class="token string interpolation type variable" style="color:hsl(207, 82%, 66%)">aws_module_version</span><span class="token string interpolation punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token string" style="color:hsl(95, 38%, 62%)">"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token comment" style="color:hsl(220, 10%, 40%)">// Other ec2_instance options</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><br></span></code></pre></figure></div></div>
<p>Finally, here's how you can set up encryption with a passphrase using a variable:</p>
<div class="language-hcl codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-hcl codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token keyword" style="color:hsl(286, 60%, 67%)">variable</span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)"> "passphrase" </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">type</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> string</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token keyword" style="color:hsl(286, 60%, 67%)">terraform</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token keyword" style="color:hsl(286, 60%, 67%)">encryption</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    key_provider </span><span class="token string" style="color:hsl(95, 38%, 62%)">"pbkdf2"</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"my_passphrase"</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      </span><span class="token property" style="color:hsl(355, 65%, 65%)">passphrase</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> var.passphrase</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    method </span><span class="token string" style="color:hsl(95, 38%, 62%)">"aes_gcm"</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"my_method"</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      </span><span class="token property" style="color:hsl(355, 65%, 65%)">keys</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> key_provider.pbkdf2.my_passphrase</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token keyword" style="color:hsl(286, 60%, 67%)">state</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      </span><span class="token property" style="color:hsl(355, 65%, 65%)">method</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> method.aes_gcm.my_method</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><br></span></code></pre></figure></div></div>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="override-files-for-opentofu-keeping-compatibility">Override files for OpenTofu: keeping compatibility<a href="https://opentofu.org/blog/opentofu-1-8-0-beta1#override-files-for-opentofu-keeping-compatibility" class="hash-link" aria-label="Direct link to Override files for OpenTofu: keeping compatibility" title="Direct link to Override files for OpenTofu: keeping compatibility">​</a></h2>
<p>Since we are now adding features to OpenTofu that are not present in Terraform, we want to give module authors the ability to write code for both OpenTofu and Terraform without needing to maintain two copies of their modules. You can now create files named <code>.tofu</code> that are exclusive to OpenTofu. If you create a file named <code>foo.tofu</code>, OpenTofu will ignore the similarly-named <code>foo.tf</code> file. You can use this functionality to put your Terraform-specific code in the <code>.tf</code> file and then override it for OpenTofu in the <code>.tofu</code> file.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="bugfixes-and-improvements">Bugfixes and improvements<a href="https://opentofu.org/blog/opentofu-1-8-0-beta1#bugfixes-and-improvements" class="hash-link" aria-label="Direct link to Bugfixes and improvements" title="Direct link to Bugfixes and improvements">​</a></h2>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="static-variable-planing">Static Variable Planing<a href="https://opentofu.org/blog/opentofu-1-8-0-beta1#static-variable-planing" class="hash-link" aria-label="Direct link to Static Variable Planing" title="Direct link to Static Variable Planing">​</a></h3>
<p>Static variables are now handled correctly when embedded in plan files. This was <a href="https://github.com/opentofu/opentofu/issues/1768" target="_blank" rel="noopener noreferrer">reported as a bug</a> found in 1.8.0-alpha1.</p>
<div class="language-bash codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-bash codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">tofu plan </span><span class="token parameter variable" style="color:hsl(207, 82%, 66%)">-out</span><span class="token operator" style="color:hsl(207, 82%, 66%)">=</span><span class="token plain">tofu.tfstate </span><span class="token parameter variable" style="color:hsl(207, 82%, 66%)">-var</span><span class="token operator" style="color:hsl(207, 82%, 66%)">=</span><span class="token string" style="color:hsl(95, 38%, 62%)">"param=value"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token comment" style="color:hsl(220, 10%, 40%)"># Variables are correctly read from the given plan and should not be specified via CLI</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">tofu show tofu.tfstate</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">tofu apply tofu.tfstate</span><br></span></code></pre></figure></div></div>
<h3 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="improved-provider-error-messages">Improved provider error messages<a href="https://opentofu.org/blog/opentofu-1-8-0-beta1#improved-provider-error-messages" class="hash-link" aria-label="Direct link to Improved provider error messages" title="Direct link to Improved provider error messages">​</a></h3>
<p>Also included in the beta is <a href="https://github.com/opentofu/opentofu/issues/1484" target="_blank" rel="noopener noreferrer">improvements in error messages produced by misconfigured providers</a>. Some defaulted providers which require configuration blocks were able to generate error messages like:</p>
<div class="codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-text codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">╷</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">│ Error: Insufficient features blocks</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">│</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">│   on &lt;empty&gt; line 0:</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">│   (source code not available)</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">│</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">│ At least 1 "features" blocks are required.</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">╵</span><br></span></code></pre></figure></div></div>
<p>This error message will now include information about which provider is encountering the specific missing-block validation issue to help the user track it down.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="providing-feedback">Providing feedback<a href="https://opentofu.org/blog/opentofu-1-8-0-beta1#providing-feedback" class="hash-link" aria-label="Direct link to Providing feedback" title="Direct link to Providing feedback">​</a></h2>
<p>Thank you for taking the time to test this preview release. If you have any feedback, please use <a href="https://github.com/opentofu/opentofu/issues/new/choose" target="_blank" rel="noopener noreferrer">a GitHub issue</a> or chat with us on the <a href="https://opentofu.org/slack/" target="_blank" rel="noopener noreferrer">OpenTofu Slack</a>.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Help us test OpenTofu 1.8.0-alpha1]]></title>
            <link>https://opentofu.org/blog/help-us-test-opentofu-1-8-0-alpha1</link>
            <guid>https://opentofu.org/blog/help-us-test-opentofu-1-8-0-alpha1</guid>
            <pubDate>Mon, 24 Jun 2024 00:00:00 GMT</pubDate>
            <description><![CDATA[Hey there, OpenTofu community! Since the last OpenTofu release we've been hard at work bringing you a much-needed improvement to the .tf language: the ability to use variables in backends, module sources, and the encryption configuration (early variable/locals evaluation). This is currently the top-voted issue on the OpenTofu GitHub and has, in various forms, been requested for years with OpenTofu's predecessor.]]></description>
            <content:encoded><![CDATA[<p>Hey there, OpenTofu community! Since the last OpenTofu release we've been hard at work bringing you a much-needed improvement to the .tf language: the ability to <strong>use variables in backends, module sources, and the encryption configuration</strong> (<em>early variable/locals evaluation</em>). This is currently the <a href="https://github.com/opentofu/opentofu/issues/1496" target="_blank" rel="noopener noreferrer">top-voted issue on the OpenTofu GitHub</a> and has, in various forms, been requested for years with OpenTofu's predecessor.</p>
<p>Additionally, we are bringing you a feature that lets you use new OpenTofu features while still keeping compatibility with Terraform as well as the ability to override resources and data sources in <code>tofu test</code>. The release also includes a host of smaller improvements and bugfixes to various parts of OpenTofu <a href="https://github.com/opentofu/opentofu/blob/main/CHANGELOG.md" target="_blank" rel="noopener noreferrer">listed in the changelog</a>.</p>
<p>Now we'd like to ask you for help: we have done everything we could to make sure that the new alpha release doesn't break anything, and we need your help to get this release tested. If you have a <strong>non-production</strong> setup that you would be willing to test any of the new features on, please give it a try and give us <a href="https://github.com/opentofu/opentofu/issues/new/choose" target="_blank" rel="noopener noreferrer">feedback using a GitHub issue</a>, even if it's just telling us that everything went well.</p>
<p>This blog post will go over how to download the new preview release and detail how each of the new features works.</p>
<div class="flex flex-col py-2 px-3 not-prose border gap-1 [&amp;+&amp;]:mt-3 [&amp;_a:hover]:text-gray-900 dark:[&amp;_a:hover]:text-gray-50 [&amp;_a>code]:font-bold [&amp;_code]:text-base [&amp;_code]:px-1.5 [&amp;_a]:underline [&amp;_p]:mb-2 bg-yellow-100 border-yellow-500 text-yellow-800 dark:bg-yellow-950 dark:border-yellow-700 dark:text-yellow-100" role="alert"><div class="flex gap-3 font-bold"><span class="flex w-4 fill-current [&amp;>svg]:w-full" aria-hidden="true"><svg viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"></path></svg></span>Warning</div><div class="leading-relaxed"><p>Do not test this release on a production project! It is not a stable release!</p></div></div>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="downloading-the-alpha-release">Downloading the alpha release<a href="https://opentofu.org/blog/help-us-test-opentofu-1-8-0-alpha1#downloading-the-alpha-release" class="hash-link" aria-label="Direct link to Downloading the alpha release" title="Direct link to Downloading the alpha release">​</a></h2>
<p>The alpha release is available exclusively from the <a href="https://github.com/opentofu/opentofu/releases/tag/v1.8.0-alpha1" target="_blank" rel="noopener noreferrer">GitHub Releases page</a>. Please select the appropriate file for your platform. Here are some quick links:</p>
<table><thead><tr><th>Platform/Device</th><th>Download link</th></tr></thead><tbody><tr><td><strong>Desktop Windows computer</strong><br>(64-bit)</td><td><a href="https://github.com/opentofu/opentofu/releases/download/v1.8.0-alpha1/tofu_1.8.0-alpha1_windows_amd64.zip" target="_blank" rel="noopener noreferrer">tofu_1.8.0-alpha1_windows_amd64.zip</a></td></tr><tr><td><strong>MacOS</strong><br>(Macbook M1 or higher; ARM64)</td><td><a href="https://github.com/opentofu/opentofu/releases/download/v1.8.0-alpha1/tofu_1.8.0-alpha1_darwin_arm64.tar.gz" target="_blank" rel="noopener noreferrer">tofu_1.8.0-alpha1_darwin_arm64.tar.gz</a></td></tr><tr><td><strong>MacOS</strong><br>(Macbook pre-M1; AMD64)</td><td><a href="https://github.com/opentofu/opentofu/releases/download/v1.8.0-alpha1/tofu_1.8.0-alpha1_darwin_amd64.tar.gz" target="_blank" rel="noopener noreferrer">tofu_1.8.0-alpha1_darwin_amd64.tar.gz</a></td></tr><tr><td><strong>Intel/AMD Linux computer or server</strong><br>(AMD64)</td><td><a href="https://github.com/opentofu/opentofu/releases/download/v1.8.0-alpha1/tofu_1.8.0-alpha1_linux_amd64.tar.gz" target="_blank" rel="noopener noreferrer">tofu_1.8.0-alpha1_linux_amd64.tar.gz</a></td></tr><tr><td><strong>ARM-based Linux computer<br>or<br>Raspberry Pi 3 or higher</strong><br>(ARM64)</td><td><a href="https://github.com/opentofu/opentofu/releases/download/v1.8.0-alpha1/tofu_1.8.0-alpha1_linux_arm64.tar.gz" target="_blank" rel="noopener noreferrer">tofu_1.8.0-alpha1_linux_arm64.tar.gz</a></td></tr></tbody></table>
<p>For the releases above, please unpack the archive and you should find the <code>tofu</code> binary inside. You can also use the <a href="https://opentofu.org/docs/intro/install/standalone/" target="_blank" rel="noopener noreferrer">standalone installer</a> to download the release with signature verification.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="early-variablelocals-evaluation">Early variable/locals evaluation<a href="https://opentofu.org/blog/help-us-test-opentofu-1-8-0-alpha1#early-variablelocals-evaluation" class="hash-link" aria-label="Direct link to Early variable/locals evaluation" title="Direct link to Early variable/locals evaluation">​</a></h2>
<p>This feature lets you use variables and locals for <strong>backends</strong>, <strong>module sources</strong> and <strong>encryption configuration</strong> as long as they are not dependent on resources, data sources or module outputs. This works even if a local is referencing a variable, for example. This is only the first in a series of improvements that will make the .tf code more flexible with more improvements coming in future releases.</p>
<p>The <code>tofu init</code> command will now consume your <code>.tfvars</code> file and let you specify variables using the <code>-var</code> and <code>-var-file</code> options. Please note that this alpha release will <em>not</em> prompt you for missing variables, which is a feature we will add later. Note, that <code>tofu init</code> will fail if it is missing variables needed for static evaluation.</p>
<p>For example, if you wanted to use the same configuration for your S3 backend and your AWS provider, you can now do this:</p>
<div class="language-hcl codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-hcl codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token keyword" style="color:hsl(286, 60%, 67%)">variable</span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)"> "aws_region" </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">default</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"us-east-1"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token keyword" style="color:hsl(286, 60%, 67%)">terraform</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token keyword" style="color:hsl(286, 60%, 67%)">backend</span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)"> "s3" </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">region</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> var.aws_region</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token keyword" style="color:hsl(286, 60%, 67%)">provider</span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)"> "aws" </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">region</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> var.aws_region</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><br></span></code></pre></figure></div></div>
<p>You can also use this to manage module versions with both registry references and git URLs.</p>
<div class="language-hcl codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-hcl codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token keyword" style="color:hsl(286, 60%, 67%)">locals</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">aws_module_version</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"5.6.1"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token keyword" style="color:hsl(286, 60%, 67%)">module</span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)"> "webserver" </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">source</span><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"terraform-aws-modules/ec2-instance/aws"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">version</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> local.aws_module_version</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token comment" style="color:hsl(220, 10%, 40%)">// Other ec2_instance options</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token keyword" style="color:hsl(286, 60%, 67%)">module</span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)"> "db" </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">source</span><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"https://github.com/terraform-aws-modules/terraform-aws-ec2-instance?ref=v</span><span class="token string interpolation punctuation" style="color:hsl(220, 14%, 71%)">$</span><span class="token string interpolation punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token string interpolation keyword" style="color:hsl(286, 60%, 67%)">local</span><span class="token string interpolation punctuation" style="color:hsl(220, 14%, 71%)">.</span><span class="token string interpolation type variable" style="color:hsl(207, 82%, 66%)">aws_module_version</span><span class="token string interpolation punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token string" style="color:hsl(95, 38%, 62%)">"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token comment" style="color:hsl(220, 10%, 40%)">// Other ec2_instance options</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><br></span></code></pre></figure></div></div>
<p>Finally, here's how you can set up encryption with a passphrase using a variable:</p>
<div class="language-hcl codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-hcl codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token keyword" style="color:hsl(286, 60%, 67%)">variable</span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)"> "passphrase" </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">type</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> string</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token keyword" style="color:hsl(286, 60%, 67%)">terraform</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token keyword" style="color:hsl(286, 60%, 67%)">encryption</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    key_provider </span><span class="token string" style="color:hsl(95, 38%, 62%)">"pbkdf2"</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"my_passphrase"</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      </span><span class="token property" style="color:hsl(355, 65%, 65%)">passphrase</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> var.passphrase</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    method </span><span class="token string" style="color:hsl(95, 38%, 62%)">"aes_gcm"</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"my_method"</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      </span><span class="token property" style="color:hsl(355, 65%, 65%)">keys</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> key_provider.pbkdf2.my_passphrase</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token keyword" style="color:hsl(286, 60%, 67%)">state</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      </span><span class="token property" style="color:hsl(355, 65%, 65%)">method</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> method.aes_gcm.my_method</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><br></span></code></pre></figure></div></div>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="override-files-for-opentofu-keeping-compatibility">Override files for OpenTofu: keeping compatibility<a href="https://opentofu.org/blog/help-us-test-opentofu-1-8-0-alpha1#override-files-for-opentofu-keeping-compatibility" class="hash-link" aria-label="Direct link to Override files for OpenTofu: keeping compatibility" title="Direct link to Override files for OpenTofu: keeping compatibility">​</a></h2>
<p>Since we are now adding features to OpenTofu that are not present in Terraform, we want to give module authors the ability to write code for both OpenTofu and Terraform without needing to maintain two copies of their modules. You can now create files named <code>.tofu</code> that are exclusive to OpenTofu. If you create a file named <code>foo.tofu</code>, OpenTofu will ignore the similarly-named <code>foo.tf</code> file. You can use this functionality to put your Terraform-specific code in the <code>.tf</code> file and then override it for OpenTofu in the <code>.tofu</code> file.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="resource-overrides-in-tofu-test">Resource overrides in <code>tofu test</code><a href="https://opentofu.org/blog/help-us-test-opentofu-1-8-0-alpha1#resource-overrides-in-tofu-test" class="hash-link" aria-label="Direct link to resource-overrides-in-tofu-test" title="Direct link to resource-overrides-in-tofu-test">​</a></h2>
<p>This version also brings an improvement for the <code>tofu test</code> command. You can now override resources, data sources and entire modules from your tests, allowing you to create similar behavior to mocks in traditional software testing. As an example, consider the following code that spins up an <code>m6i.2xlarge</code> instance on AWS:</p>
<div class="language-hcl codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-hcl codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token keyword" style="color:hsl(286, 60%, 67%)">provider</span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)"> "aws" </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">region</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"us-east-1"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token keyword" style="color:hsl(286, 60%, 67%)">data </span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)">"aws_ami"</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"ubuntu"</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">most_recent</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token boolean" style="color:hsl(29, 54%, 61%)">true</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token keyword" style="color:hsl(286, 60%, 67%)">filter</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      </span><span class="token property" style="color:hsl(355, 65%, 65%)">name</span><span class="token plain">   </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"name"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      </span><span class="token property" style="color:hsl(355, 65%, 65%)">values</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">[</span><span class="token string" style="color:hsl(95, 38%, 62%)">"ubuntu/images/hvm-ssd/ubuntu-jammy-24.04-amd64-server-*"</span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">owners</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">[</span><span class="token string" style="color:hsl(95, 38%, 62%)">"099720109477"</span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token keyword" style="color:hsl(286, 60%, 67%)">resource </span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)">"aws_instance"</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"web"</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">ami</span><span class="token plain">           </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> data.aws_ami.ubuntu.id</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">instance_type</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"m6i.2xlarge"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><br></span></code></pre></figure></div></div>
<p>Instead of querying the AMI ID and spinning up the instance, we can write test code as follows:</p>
<div class="language-hcl codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-hcl codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token keyword" style="color:hsl(286, 60%, 67%)">provider</span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)"> "aws" </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">access_key</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"foo"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">secret_key</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"bar"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">skip_credentials_validation</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token boolean" style="color:hsl(29, 54%, 61%)">true</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">skip_region_validation</span><span class="token plain">      </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token boolean" style="color:hsl(29, 54%, 61%)">true</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">skip_metadata_api_check</span><span class="token plain">     </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token boolean" style="color:hsl(29, 54%, 61%)">true</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">skip_requesting_account_id</span><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token boolean" style="color:hsl(29, 54%, 61%)">true</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token comment" style="color:hsl(220, 10%, 40%)"># This block disables refreshing the aws_ami.ubuntu data source</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token comment" style="color:hsl(220, 10%, 40%)"># and lets you manually specify the values:</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token keyword" style="color:hsl(286, 60%, 67%)">override_data</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">target</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> data.aws_ami.ubuntu</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">values</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">id</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"ami-12345"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">run </span><span class="token string" style="color:hsl(95, 38%, 62%)">"test"</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token comment" style="color:hsl(220, 10%, 40%)"># This block disables provisioning the aws_instance.web resource:</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token keyword" style="color:hsl(286, 60%, 67%)">override_resource</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">target</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> aws_instance.web</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">values</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      </span><span class="token comment" style="color:hsl(220, 10%, 40%)"># You can add values here.</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token keyword" style="color:hsl(286, 60%, 67%)">assert</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">condition</span><span class="token plain">     </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> aws_instance.web.ami </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"ami-12345"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">error_message</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"Incorrect AMI ID passed to aws_instance.web: </span><span class="token string interpolation punctuation" style="color:hsl(220, 14%, 71%)">$</span><span class="token string interpolation punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token string interpolation" style="color:hsl(95, 38%, 62%)">aws_instance</span><span class="token string interpolation punctuation" style="color:hsl(220, 14%, 71%)">.</span><span class="token string interpolation" style="color:hsl(95, 38%, 62%)">web</span><span class="token string interpolation punctuation" style="color:hsl(220, 14%, 71%)">.</span><span class="token string interpolation" style="color:hsl(95, 38%, 62%)">ami</span><span class="token string interpolation punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token string" style="color:hsl(95, 38%, 62%)">"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><br></span></code></pre></figure></div></div>
<p>While this will not fully test the entire provisioning, it will highlight errors that may be caused by incorrectly connecting resources together without the need for an actual AWS account. Similarly, you can use <code>override_module</code> to override an entire module.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="providing-feedback">Providing feedback<a href="https://opentofu.org/blog/help-us-test-opentofu-1-8-0-alpha1#providing-feedback" class="hash-link" aria-label="Direct link to Providing feedback" title="Direct link to Providing feedback">​</a></h2>
<p>Thank you for taking the time to test this preview release. If you have any feedback, please use <a href="https://github.com/opentofu/opentofu/issues/new/choose" target="_blank" rel="noopener noreferrer">a GitHub issue</a> or chat with us on the <a href="https://opentofu.org/slack/" target="_blank" rel="noopener noreferrer">OpenTofu Slack</a>.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OpenTofu 1.7.0 is out with State Encryption, Dynamic Provider-Defined Functions, and more]]></title>
            <link>https://opentofu.org/blog/opentofu-1-7-0</link>
            <guid>https://opentofu.org/blog/opentofu-1-7-0</guid>
            <pubDate>Tue, 30 Apr 2024 00:00:00 GMT</pubDate>
            <description><![CDATA[OpenTofu 1.7.0 is now available with full state encryption, dynamic provider-defined functions, the removed and loopable import blocks, new migration guides, and much more.]]></description>
            <content:encoded><![CDATA[<p>In the last few months <a href="https://opentofu.org/blog/opentofu-is-going-ga/">since our first stable release</a> the OpenTofu community and the core team have worked hand in hand to bring functionality to OpenTofu that has been requested for years. We are proud to announce the immediate availability of <a href="https://github.com/opentofu/opentofu/releases/tag/v1.7.0" target="_blank" rel="noopener noreferrer">OpenTofu 1.7.0</a>, bringing you the following highlights:</p>
<ul>
<li><a href="https://opentofu.org/docs/v1.7/intro/whats-new/#state-encryption"><strong>End-to-end state encryption</strong></a> protects your state file from prying eyes, no matter what storage backend you use. You can provide your encryption passphrase securely using environment variables, or use a key management system such as AWS KMS, GCP KMS, or OpenBao. <em>This feature has been developed in collaboration with Stephan Bartels (Interhyp) and Alex Scheel from the OpenTofu community, whom we would like to thank for their work on this feature.</em></li>
<li><a href="https://opentofu.org/docs/v1.7/intro/whats-new/#provider-defined-functions"><strong>Dynamic provider-defined functions</strong></a> let a provider not only provide resources, but also native functions you can use in your OpenTofu code. What's more, we added an OpenTofu-only feature to let providers dynamically define custom functions based on your configuration. This enhancement allows you to fully integrate other programming languages as <a href="https://www.youtube.com/watch?v=6OXBv0MYalY" target="_blank" rel="noopener noreferrer">shown in our live stream</a>. You can try out this functionality with our experimental <a href="https://github.com/opentofu/terraform-provider-lua" target="_blank" rel="noopener noreferrer">Lua</a> and <a href="https://github.com/opentofu/terraform-provider-go" target="_blank" rel="noopener noreferrer">Go</a> providers.</li>
<li><a href="https://opentofu.org/docs/intro/whats-new/#removed-block"><strong>The removed block</strong></a> lets you mark OpenTofu-created resources for removal from the state file, but still keep the infrastructure you created.</li>
<li><a href="https://opentofu.org/docs/intro/whats-new/#loopable-import-blocks"><strong>Loopable import blocks</strong></a> let you bulk-import resources declaratively in your OpenTofu code, helping with large-scale migrations.</li>
</ul>
<p>As with the previous version, OpenTofu remains a drop-in replacement for its predecessor Terraform™ 1.5 and has easy migration paths from later versions. Check out the overhauled <a href="https://opentofu.org/docs/v1.7/intro/migration/"><strong>migration guides</strong></a> for detailed migration instructions. You can find the full list of changes and comprehensive examples <a href="https://opentofu.org/docs/v1.7/intro/whats-new/">in the documentation</a>.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="the-opentofu-community-grew-significantly">The OpenTofu community grew significantly<a href="https://opentofu.org/blog/opentofu-1-7-0#the-opentofu-community-grew-significantly" class="hash-link" aria-label="Direct link to The OpenTofu community grew significantly" title="Direct link to The OpenTofu community grew significantly">​</a></h2>
<p>Since the first release, the OpenTofu community and adoption have been growing significantly. While we don't believe in tracking our users and don't have accurate numbers, we have seen a constant month-over-month growth in our registry usage since our launch only 4 months ago. Over just the last month our registry usage has more than doubled to well over a million requests per day.</p>
<p><img loading="lazy" alt="A graph showing OpenTofu&amp;#39;s registry usage." src="https://opentofu.org/assets/images/opentofu-registry-april-2024-f9521461bf6bc2583f816431afb75c9f.svg" width="1542" height="620" class="img_ev3q"></p>
<p>Additionally, we had 65 unique contributors for this release alone and have recently reached 20,000 stars on GitHub. Since January, we have seen our community spread the word about OpenTofu, open over 200 new issues and file even more pull requests.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="what-is-opentofu-anyway">What is OpenTofu anyway?<a href="https://opentofu.org/blog/opentofu-1-7-0#what-is-opentofu-anyway" class="hash-link" aria-label="Direct link to What is OpenTofu anyway?" title="Direct link to What is OpenTofu anyway?">​</a></h2>
<p>If you are new to OpenTofu, welcome! We started as a fork of HashiCorp's Terraform™ after its license was changed to the restrictive BUSL alongside a frequently changing licensing FAQ. OpenTofu is an infrastructure-as-code tool that lets you declaratively create cloud infrastructure with thousands of APIs by writing your own code or using one of the tens of thousands of community-provided modules.</p>
<p>For example, you could create an EC2 instance on AWS like this:</p>
<div class="language-hcl codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-hcl codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token keyword" style="color:hsl(286, 60%, 67%)">resource </span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)">"aws_instance"</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"web"</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">ami</span><span class="token plain">           </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"add AMI ID here"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">instance_type</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"t3.micro"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><br></span></code></pre></figure></div></div>
<p>OpenTofu's main advantage is that it records any changes to your cloud infrastructure in a state file, which allows it to later modify the same infrastructure, or tear it down if you created it as a test.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="the-future-and-beyond-opentofu-18-is-waiting">The future and beyond: OpenTofu 1.8 is waiting<a href="https://opentofu.org/blog/opentofu-1-7-0#the-future-and-beyond-opentofu-18-is-waiting" class="hash-link" aria-label="Direct link to The future and beyond: OpenTofu 1.8 is waiting" title="Direct link to The future and beyond: OpenTofu 1.8 is waiting">​</a></h2>
<p>OpenTofu is first and foremost a community-driven project. We are looking forward to the continued tradition of working on issues the community deems important. For transparency and to encourage everyone to vote, we have created <a href="https://github.com/opentofu/opentofu/issues/1496" target="_blank" rel="noopener noreferrer">a list of the most upvoted issues</a>.</p>
<p>While much of OpenTofu 1.8 is still in planning, we are currently finalizing a proposal for a feature that lets you <a href="https://github.com/opentofu/opentofu/issues/1042" target="_blank" rel="noopener noreferrer">use variables as module sources, backend configuration, and more</a>. Early evaluation of variables has been requested in over 30 issues so far and is one of the most-requested features in OpenTofu.</p>
<p>If you have a feature you would like to see in OpenTofu, please don't hesitate to <a href="https://github.com/opentofu/opentofu/issues/new/choose" target="_blank" rel="noopener noreferrer">open an issue</a> or <a href="https://opentofu.org/slack/" target="_blank" rel="noopener noreferrer">reach out to us on Slack</a>.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Get ready for OpenTofu 1.7.0-beta1]]></title>
            <link>https://opentofu.org/blog/opentofu-1-7-0-beta1</link>
            <guid>https://opentofu.org/blog/opentofu-1-7-0-beta1</guid>
            <pubDate>Thu, 18 Apr 2024 00:00:00 GMT</pubDate>
            <description><![CDATA[This version includes provider-defined functions and significant improvements from the alpha version.]]></description>
            <content:encoded><![CDATA[<p>This version includes provider-defined functions and significant improvements from the alpha version.</p>
<p>As with the <a href="https://opentofu.org/blog/help-us-test-opentofu-1-7-0-alpha1/">alpha version</a>, 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 <strong>non-production</strong> workloads. <a href="https://github.com/opentofu/opentofu/releases/tag/v1.7.0-beta1" target="_blank" rel="noopener noreferrer">Grab your copy on GitHub</a> and let us know what you think using <a href="https://github.com/opentofu/opentofu/issues/new/choose" target="_blank" rel="noopener noreferrer">a GitHub issue</a>.</p>
<div class="flex flex-col py-2 px-3 not-prose border gap-1 [&amp;+&amp;]:mt-3 [&amp;_a:hover]:text-gray-900 dark:[&amp;_a:hover]:text-gray-50 [&amp;_a>code]:font-bold [&amp;_code]:text-base [&amp;_code]:px-1.5 [&amp;_a]:underline [&amp;_p]:mb-2 bg-yellow-100 border-yellow-500 text-yellow-800 dark:bg-yellow-950 dark:border-yellow-700 dark:text-yellow-100" role="alert"><div class="flex gap-3 font-bold"><span class="flex w-4 fill-current [&amp;>svg]:w-full" aria-hidden="true"><svg viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"></path></svg></span>Warning</div><div class="leading-relaxed"><p>Do not test this release on a production project! It is not a stable release!</p></div></div>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="downloading-the-beta-release">Downloading the beta release<a href="https://opentofu.org/blog/opentofu-1-7-0-beta1#downloading-the-beta-release" class="hash-link" aria-label="Direct link to Downloading the beta release" title="Direct link to Downloading the beta release">​</a></h2>
<p>The beta release is available exclusively from the <a href="https://github.com/opentofu/opentofu/releases/tag/v1.7.0-beta1" target="_blank" rel="noopener noreferrer">GitHub Releases page</a>. Please select the appropriate file for your platform. Here are some quick links:</p>
<table><thead><tr><th>Platform/Device</th><th>Download link</th></tr></thead><tbody><tr><td><strong>Desktop Windows computer</strong><br>(64-bit)</td><td><a href="https://github.com/opentofu/opentofu/releases/download/v1.7.0-beta1/tofu_1.7.0-beta1_windows_amd64.zip" target="_blank" rel="noopener noreferrer">tofu_1.7.0-beta1_windows_amd64.zip</a></td></tr><tr><td><strong>MacOS</strong><br>(Macbook M1 or higher; ARM64)</td><td><a href="https://github.com/opentofu/opentofu/releases/download/v1.7.0-beta1/tofu_1.7.0-beta1_darwin_arm64.tar.gz" target="_blank" rel="noopener noreferrer">tofu_1.7.0-beta1_darwin_arm64.tar.gz</a></td></tr><tr><td><strong>MacOS</strong><br>(Macbook pre-M1 or lower; AMD64)</td><td><a href="https://github.com/opentofu/opentofu/releases/download/v1.7.0-beta1/tofu_1.7.0-beta1_darwin_amd64.tar.gz" target="_blank" rel="noopener noreferrer">tofu_1.7.0-beta1_darwin_amd64.tar.gz</a></td></tr><tr><td><strong>Intel/AMD Linux computer or server</strong><br>(AMD64)</td><td><a href="https://github.com/opentofu/opentofu/releases/download/v1.7.0-beta1/tofu_1.7.0-beta1_linux_amd64.tar.gz" target="_blank" rel="noopener noreferrer">tofu_1.7.0-beta1_linux_amd64.tar.gz</a></td></tr><tr><td><strong>ARM-based Linux computer<br>or<br>Raspberry Pi 3 or higher</strong><br>(ARM64)</td><td><a href="https://github.com/opentofu/opentofu/releases/download/v1.7.0-beta1/tofu_1.7.0-beta1_linux_arm64.tar.gz" target="_blank" rel="noopener noreferrer">tofu_1.7.0-beta1_linux_arm64.tar.gz</a></td></tr></tbody></table>
<p>For the releases above, please unpack the archive and you should find the <code>tofu</code> binary inside. You can also use the <a href="https://opentofu.org/docs/intro/install/standalone/" target="_blank" rel="noopener noreferrer">standalone installer</a> to download the release with signature verification.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="provider-defined-functions">Provider-defined functions<a href="https://opentofu.org/blog/opentofu-1-7-0-beta1#provider-defined-functions" class="hash-link" aria-label="Direct link to Provider-defined functions" title="Direct link to Provider-defined functions">​</a></h2>
<p>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.</p>
<p>If you want to test provider-defined functions, you can use the <a href="https://library.tf/providers/northwood-labs/corefunc/latest" target="_blank" rel="noopener noreferrer">corefunc</a> provider by <a href="https://github.com/skyzyx" target="_blank" rel="noopener noreferrer">Ryan Parman</a>:</p>
<div class="language-hcl codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-hcl codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token keyword" style="color:hsl(286, 60%, 67%)">terraform</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token keyword" style="color:hsl(286, 60%, 67%)">required_providers</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token property" style="color:hsl(355, 65%, 65%)">corefunc</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      </span><span class="token property" style="color:hsl(355, 65%, 65%)">source</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"northwood-labs/corefunc"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      </span><span class="token property" style="color:hsl(355, 65%, 65%)">version</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"1.4.0"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token keyword" style="color:hsl(286, 60%, 67%)">provider</span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)"> "corefunc" </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token keyword" style="color:hsl(286, 60%, 67%)">output</span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)"> "test" </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">value</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> provider::corefunc::str_snake(</span><span class="token string" style="color:hsl(95, 38%, 62%)">"Hello world!"</span><span class="token plain">)</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token comment" style="color:hsl(220, 10%, 40%)"># Prints: hello_world</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><br></span></code></pre></figure></div></div>
<div class="flex flex-col py-2 px-3 not-prose border gap-1 [&amp;+&amp;]:mt-3 [&amp;_a:hover]:text-gray-900 dark:[&amp;_a:hover]:text-gray-50 [&amp;_a>code]:font-bold [&amp;_code]:text-base [&amp;_code]:px-1.5 [&amp;_a]:underline [&amp;_p]:mb-2 bg-sky-100 border-sky-300 text-sky-800 dark:bg-sky-950 dark:border-sky-700 dark:text-sky-100" role="alert"><div class="flex gap-3 font-bold"><span class="flex w-4 fill-current [&amp;>svg]:w-full" aria-hidden="true"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>Note</div><div class="leading-relaxed"><p>If you are interested in a detailed breakdown of this functionality and some of the new unique features OpenTofu brings in this area, <a href="https://www.youtube.com/watch?v=6OXBv0MYalY" target="_blank" rel="noopener noreferrer">join our live stream on April 24</a>.</p></div></div>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="loopable-import-blocks">Loopable import blocks<a href="https://opentofu.org/blog/opentofu-1-7-0-beta1#loopable-import-blocks" class="hash-link" aria-label="Direct link to Loopable import blocks" title="Direct link to Loopable import blocks">​</a></h2>
<p>We made several improvements to the declarative import blocks, most prominently you can now use the <code>for_each</code> instruction on the block. We have prepared a <a href="https://opentofu.org/docs/language/import/#importing-multiple-resources">full documentation</a> for this feature.</p>
<p>In previous OpenTofu versions, you could already use the <code>import</code> block to declaratively import resources, for example:</p>
<div class="language-hcl codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-hcl codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token keyword" style="color:hsl(286, 60%, 67%)">resource </span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)">"random_id"</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"test_id"</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">byte_length</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token number" style="color:hsl(29, 54%, 61%)">8</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token keyword" style="color:hsl(286, 60%, 67%)">import</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">to</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> random_id.test_id</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">id</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"Y2FpOGV1Mkk"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token keyword" style="color:hsl(286, 60%, 67%)">output</span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)"> "id" </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">value</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> random_id.test_id.b64_url</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><br></span></code></pre></figure></div></div>
<p>In this new version you can now also declaratively import resources in a loop:</p>
<div class="language-hcl codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-hcl codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token keyword" style="color:hsl(286, 60%, 67%)">variable</span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)"> "server_ids" </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">type</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> list(string)</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token keyword" style="color:hsl(286, 60%, 67%)">resource </span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)">"random_id"</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"test_id"</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">byte_length</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token number" style="color:hsl(29, 54%, 61%)">8</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">count</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token number" style="color:hsl(29, 54%, 61%)">2</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token keyword" style="color:hsl(286, 60%, 67%)">import</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">to</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> random_id.test_id</span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">[</span><span class="token plain">tonumber(each.key)</span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">]</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">id</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> each.value</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">for_each</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    for idx, item in var.server_ids: </span><span class="token property" style="color:hsl(355, 65%, 65%)">idx</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain">&gt; item</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token keyword" style="color:hsl(286, 60%, 67%)">output</span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)"> "id" </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">value</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> random_id.test_id.*.b64_url</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><br></span></code></pre></figure></div></div>
<p>The example above will let you specify some random IDs from a variable, and let others be automatically generated.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="state-encryption">State encryption<a href="https://opentofu.org/blog/opentofu-1-7-0-beta1#state-encryption" class="hash-link" aria-label="Direct link to State encryption" title="Direct link to State encryption">​</a></h2>
<p>State encryption is one of the flagship features of this release. We have prepared a <a href="https://opentofu.org/docs/language/state/encryption/">full documentation</a> 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.</p>
<p>Before you test this feature, please <strong>make a backup</strong> of your state file. You can then add the following block to enable state encryption:</p>
<div class="language-hcl codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-hcl codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token keyword" style="color:hsl(286, 60%, 67%)">terraform</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token keyword" style="color:hsl(286, 60%, 67%)">encryption</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    key_provider </span><span class="token string" style="color:hsl(95, 38%, 62%)">"pbkdf2"</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"my_passphrase"</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      </span><span class="token comment" style="color:hsl(220, 10%, 40%)">## Enter a passphrase here:</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      </span><span class="token property" style="color:hsl(355, 65%, 65%)">passphrase</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">""</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    method </span><span class="token string" style="color:hsl(95, 38%, 62%)">"aes_gcm"</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"my_method"</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      </span><span class="token property" style="color:hsl(355, 65%, 65%)">keys</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> key_provider.pbkdf2.my_passphrase</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token comment" style="color:hsl(220, 10%, 40%)">## Remove this after the migration:</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    method </span><span class="token string" style="color:hsl(95, 38%, 62%)">"unencrypted"</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"migration"</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token keyword" style="color:hsl(286, 60%, 67%)">state</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      </span><span class="token property" style="color:hsl(355, 65%, 65%)">method</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> method.aes_gcm.my_method</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      </span><span class="token comment" style="color:hsl(220, 10%, 40%)">## Remove the fallback block after migration:</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      fallback</span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">        </span><span class="token property" style="color:hsl(355, 65%, 65%)">method</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> method.unencrypted.migration</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      </span><span class="token comment" style="color:hsl(220, 10%, 40%)">## Enable this after migration:</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      </span><span class="token comment" style="color:hsl(220, 10%, 40%)">#enforced = true</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><br></span></code></pre></figure></div></div>
<p>You can migrate back using the following syntax:</p>
<div class="language-hcl codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-hcl codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token keyword" style="color:hsl(286, 60%, 67%)">terraform</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token keyword" style="color:hsl(286, 60%, 67%)">encryption</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    key_provider </span><span class="token string" style="color:hsl(95, 38%, 62%)">"pbkdf2"</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"my_passphrase"</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      </span><span class="token comment" style="color:hsl(220, 10%, 40%)">## Enter a passphrase here:</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      </span><span class="token property" style="color:hsl(355, 65%, 65%)">passphrase</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">""</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    method </span><span class="token string" style="color:hsl(95, 38%, 62%)">"aes_gcm"</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"my_method"</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      </span><span class="token property" style="color:hsl(355, 65%, 65%)">keys</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> key_provider.pbkdf2.my_passphrase</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    method </span><span class="token string" style="color:hsl(95, 38%, 62%)">"unencrypted"</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"migration"</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token keyword" style="color:hsl(286, 60%, 67%)">state</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      </span><span class="token property" style="color:hsl(355, 65%, 65%)">method</span><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> method.unencrypted.migration</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      </span><span class="token property" style="color:hsl(355, 65%, 65%)">enforced</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token boolean" style="color:hsl(29, 54%, 61%)">false</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      fallback</span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">        </span><span class="token property" style="color:hsl(355, 65%, 65%)">method</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> method.aes_gcm.my_method</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">      </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">    </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><br></span></code></pre></figure></div></div>
<p>If you have access to an AWS, GCP account, or an OpenBao/MPL-licensed HashiCorp Vault installation, you can also <a href="https://opentofu.org/docs/language/state/encryption/#key-providers">test these key providers</a>.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="removed-block">Removed block<a href="https://opentofu.org/blog/opentofu-1-7-0-beta1#removed-block" class="hash-link" aria-label="Direct link to Removed block" title="Direct link to Removed block">​</a></h2>
<p>The removed block lets you remove a resource from the state file but keep it on the infrastructure. We have prepared a <a href="https://opentofu.org/docs/language/resources/syntax/#removing-resources">full documentation</a> for this feature. You can test it by creating a resource first:</p>
<div class="language-hcl codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-hcl codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token keyword" style="color:hsl(286, 60%, 67%)">resource </span><span class="token keyword type variable" style="color:hsl(207, 82%, 66%)">"local_file"</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"test"</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">content</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"Hello world!"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">filename</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> </span><span class="token string" style="color:hsl(95, 38%, 62%)">"test.txt"</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><br></span></code></pre></figure></div></div>
<p>After applying, you can replace the resource with a removed block:</p>
<div class="language-hcl codeBlockContainer_APcc theme-code-block" style="--prism-background-color:hsl(220, 13%, 18%);--prism-color:hsl(220, 14%, 71%)"><div class="codeBlockContent_m3Ux"><figure><figcaption class="sr-only">Code Block</figcaption><div class="buttonGroup_6DOT"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_FhaS" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_phi_"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_FfTR"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div><pre tabindex="0" class="prism-code language-hcl codeBlock_qGQc thin-scrollbar" style="background-color:hsl(220, 13%, 18%);color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)" role="code" aria-label="Code Block"><code class="codeBlockLines_p187"><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token keyword" style="color:hsl(286, 60%, 67%)">removed</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain">  </span><span class="token property" style="color:hsl(355, 65%, 65%)">from</span><span class="token plain"> </span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">=</span><span class="token plain"> local_file.test</span><br></span><span class="token-line" style="color:hsl(220, 14%, 71%);text-shadow:0 1px rgba(0, 0, 0, 0.3)"><span class="token plain"></span><span class="token punctuation" style="color:hsl(220, 14%, 71%)">}</span><br></span></code></pre></figure></div></div>
<p>After the next apply, you will see that the <code>local_file.test</code> resource no longer exists in your state file, but the <code>test.txt</code> file should still exist on your disk. You can now remove the removed block safely.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="built-in-function-changes">Built-in function changes<a href="https://opentofu.org/blog/opentofu-1-7-0-beta1#built-in-function-changes" class="hash-link" aria-label="Direct link to Built-in function changes" title="Direct link to Built-in function changes">​</a></h2>
<p>This release also contains several new functions and changes to existing functions:</p>
<ul>
<li>New function: <a href="https://opentofu.org/docs/language/functions/templatestring/">templatestring</a></li>
<li>New function: <a href="https://opentofu.org/docs/language/functions/base64gunzip/">base64gunzip</a></li>
<li>New function: <a href="https://opentofu.org/docs/language/functions/cidrcontains/">cidrcontains</a></li>
<li>New function: <a href="https://opentofu.org/docs/language/functions/urldecode/">urldecode</a></li>
<li>New function: <a href="https://opentofu.org/docs/language/functions/issensitive/">issensitive</a></li>
<li><a href="https://opentofu.org/docs/language/functions/nonsensitive/">nonsensitive</a> no longer returns an error when the applied values are not sensitive.</li>
<li><a href="https://opentofu.org/docs/language/functions/templatefile/">templatefile</a> now supports recursion up to a depth of 1024.</li>
</ul>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="cli-changes">CLI changes<a href="https://opentofu.org/blog/opentofu-1-7-0-beta1#cli-changes" class="hash-link" aria-label="Direct link to CLI changes" title="Direct link to CLI changes">​</a></h2>
<p>There are also several changes to the CLI:</p>
<ul>
<li><code>tofu init</code> now supports the <code>-json</code> flag for JSON output.</li>
<li><code>tofu plan</code> now has a <code>-concise</code> flag to shorten the plan output.</li>
<li><code>tofu console</code> now works on Solaris and AIX.</li>
<li>The CLI now supports the XDG directory specification.</li>
<li>Aliases for:<!-- -->
<ul>
<li><code>state list</code> → <code>state ls</code></li>
<li><code>state mv</code> → <code>state move</code></li>
<li><code>state rm</code> → <code>state remove</code></li>
</ul>
</li>
</ul>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="testing-feature-changes">Testing feature changes<a href="https://opentofu.org/blog/opentofu-1-7-0-beta1#testing-feature-changes" class="hash-link" aria-label="Direct link to Testing feature changes" title="Direct link to Testing feature changes">​</a></h2>
<ul>
<li>Tofu now reads the <code>.tfvars</code> file from the tests folder.</li>
</ul>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="providing-feedback">Providing feedback<a href="https://opentofu.org/blog/opentofu-1-7-0-beta1#providing-feedback" class="hash-link" aria-label="Direct link to Providing feedback" title="Direct link to Providing feedback">​</a></h2>
<p>Thank you for taking the time to test this preview release. If you have any feedback, please use <a href="https://github.com/opentofu/opentofu/issues/new/choose" target="_blank" rel="noopener noreferrer">a GitHub issue</a> or chat with us on the <a href="https://opentofu.org/slack/" target="_blank" rel="noopener noreferrer">OpenTofu Slack</a>.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Our Response to Hashicorp's Cease and Desist Letter]]></title>
            <link>https://opentofu.org/blog/our-response-to-hashicorps-cease-and-desist</link>
            <guid>https://opentofu.org/blog/our-response-to-hashicorps-cease-and-desist</guid>
            <pubDate>Thu, 11 Apr 2024 00:00:00 GMT</pubDate>
            <description><![CDATA[On April 3rd, we received a Cease and Desist letter from HashiCorp regarding our implementation of the "removed" block in OpenTofu, claiming copyright infringement on the part of one of our core developers. We were also made aware of an article posted that same day with the same accusations. We have investigated these claims and are publishing the C&D letter, our response and the source code origin document resulting from our investigation.]]></description>
            <content:encoded><![CDATA[<p>On April 3rd, we received a Cease and Desist letter from HashiCorp regarding our implementation of the "removed" block in OpenTofu, claiming copyright infringement on the part of one of our core developers. We were also made aware of an article posted that same day with the same accusations. We have investigated these claims and are publishing the C&amp;D letter, our response and the source code origin document resulting from our investigation.</p>
<p><strong>The OpenTofu team vehemently disagrees with any suggestion that it misappropriated, mis-sourced, or otherwise misused HashiCorp’s BSL code. All such statements have zero basis in facts.</strong></p>
<p>HashiCorp has made claims of copyright infringement in a cease &amp; desist letter. These claims are <strong>completely unsubstantiated</strong>.</p>
<p>The code in question can be clearly shown to have been copied from older code under the MPL-2.0 license. HashiCorp seems to have copied the same code itself when they implemented their version of this feature. All of this is easily visible in our detailed SCO analysis, as well as their own comments which indicate this.</p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="documents">Documents<a href="https://opentofu.org/blog/our-response-to-hashicorps-cease-and-desist#documents" class="hash-link" aria-label="Direct link to Documents" title="Direct link to Documents">​</a></h2>
<ul>
<li><a href="https://opentofu.github.io/legal-documents/2024-04-03%20HashiCorp%20C%26D/OpenTofu%20C&amp;D%20-%20Redacted.pdf" target="_blank" rel="noopener noreferrer">HashiCorp's C&amp;D Letter</a></li>
<li><a href="https://opentofu.github.io/legal-documents/2024-04-03%20HashiCorp%20C%26D/OpenTofu%20C&amp;D%20Response%20-%20Redacted.pdf" target="_blank" rel="noopener noreferrer">Our Response</a></li>
<li>Source Code Origin Document: [<a href="https://opentofu.github.io/legal-documents/2024-04-03%20HashiCorp%20C%26D/SCO.html" target="_blank" rel="noopener noreferrer">HTML</a>, <a href="https://opentofu.github.io/legal-documents/2024-04-03%20HashiCorp%20C%26D/SCO.pdf" target="_blank" rel="noopener noreferrer">PDF</a>] <strong>⇐ For the detailed code analysis, see here.</strong></li>
</ul>
<p><em>To prevent further harassment of individual people, we have redacted any personal information from these documents.</em></p>
<h2 class="anchor anchorWithHideOnScrollNavbar_WYt5" id="conclusion">Conclusion<a href="https://opentofu.org/blog/our-response-to-hashicorps-cease-and-desist#conclusion" class="hash-link" aria-label="Direct link to Conclusion" title="Direct link to Conclusion">​</a></h2>
<p>Despite these events, we have managed to carry out significant development on OpenTofu 1.7, including state encryption, “for_each” implementation for “import” blocks, as well as the all-new <strong>provider-defined functions</strong> supported by the recently released provider plugin protocol.</p>
<p>On that note, we will be releasing a new pre-release version next week, and we are eager to gather feedback from the community.</p>
<p>— The OpenTofu Team</p>
<hr>
<small><p><em>The image in this blog post contains code licensed under the BUSL-1.1 by HashiCorp. However, for the purposes of this post we are making non-commercial, transformative fair use under <a href="https://www.govinfo.gov/content/pkg/USCODE-2022-title17/html/USCODE-2022-title17-chap1-sec107.htm" target="_blank" rel="noopener noreferrer">17 U.S. Code § 107</a>. <br> You can read more about fair use on the <a href="https://www.copyright.gov/fair-use/" target="_blank" rel="noopener noreferrer">website of the US Copyright Office</a>.</em></p></small>]]></content:encoded>
        </item>
    </channel>
</rss>