<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[codycodescloud]]></title><description><![CDATA[I like to build cloud-y things and share them. Azure is my daily driver and Terraform & Kubernetes are my jam.]]></description><link>https://blog.codycodes.cloud</link><image><url>https://cdn.hashnode.com/uploads/logos/69da8f7ac8e5007ddbd46077/6f3d6b2e-2191-49a3-94c2-8dd934083f1d.jpg</url><title>codycodescloud</title><link>https://blog.codycodes.cloud</link></image><generator>RSS for Node</generator><lastBuildDate>Tue, 19 May 2026 04:23:39 GMT</lastBuildDate><atom:link href="https://blog.codycodes.cloud/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[azurerm 4.67 Brings Full Terraform Control Over AKS Host Encryption]]></title><description><![CDATA[AKS has been around since 2018, however until just recently, in Terraform, one could not provision such a cluster with disk encryption enabled without first enabling a feature for the subscription to ]]></description><link>https://blog.codycodes.cloud/azurerm-4-67-brings-full-terraform-control-over-aks-host-encryption</link><guid isPermaLink="true">https://blog.codycodes.cloud/azurerm-4-67-brings-full-terraform-control-over-aks-host-encryption</guid><category><![CDATA[#IaC]]></category><category><![CDATA[Terraform]]></category><category><![CDATA[Azure]]></category><category><![CDATA[Kubernetes]]></category><category><![CDATA[aks]]></category><dc:creator><![CDATA[codycodescloud]]></dc:creator><pubDate>Mon, 13 Apr 2026 23:07:23 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/69da8f7ac8e5007ddbd46077/d9cec35f-9baf-4997-9b50-ee70de6b2fd1.jpg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>AKS has been around since 2018, however until just recently, in Terraform, one could not provision such a cluster with disk encryption enabled without first enabling a feature for the subscription to do so manually... leading to the following:</p>
<img src="https://cdn.hashnode.com/uploads/covers/69da8f7ac8e5007ddbd46077/f9460b3b-5292-439a-bfca-1dcb13fd67d2.png" alt="" style="display:block;margin:0 auto" />

<p>Instead, engineers would be expected to use the <code>az</code> command or <a href="https://en.wiktionary.org/wiki/ClickOps">ClickOps</a> their way to success outside of the normal Terraform lifecycle, which creates tons of friction in getting new services stood up.</p>
<p>Luckily, a sweet new resource was just released in the <code>azurerm</code> Terraform provider to right this wrong!</p>
<h3>Enter <code>azurerm_resource_provider_feature_registration</code></h3>
<p>With the <a href="https://github.com/hashicorp/terraform-provider-azurerm/releases/tag/v4.67.0">4.67</a> release of the <code>azurerm</code> provider, we get a new resource: <a href="https://registry.terraform.io/providers/hashicorp/Azurerm/latest/docs/resources/resource_provider_registration"><code>azurerm_resource_provider_feature_registration</code></a> 🎉</p>
<p>Now you may be thinking "but I can already automate provider registrations since azurerm 4.0! What is the meaning of this, Cody"? Look closely, as <em>this</em> resource is specifically for <strong>feature registration</strong>. As it turns out there are certain parts of Azure which cannot be enabled via provider registrations alone: they require feature registrations which are enabled <em>under</em> a provider's registration.</p>
<p>Let's take a look at the example here for our handy dandy AKS resource which should help clarify:</p>
<pre><code class="language-shell">resource "azurerm_resource_provider_feature_registration" "encryption_at_host" {
  name          = "EncryptionAtHost"
  provider_name = "Microsoft.Compute"
}
</code></pre>
<p>As we can see here we have the <code>name</code> of the feature in addition to the <code>provider_name</code> it belongs to. So naturally we can interpret that a feature lives <em>under</em> a specific provider.</p>
<img src="https://cdn.hashnode.com/uploads/covers/69da8f7ac8e5007ddbd46077/0377915f-f250-4b31-bcb2-65986c5ff010.gif" alt="" style="display:block;margin:0 auto" />

<p><em>Pretty straightforward &amp; simple, right? Two thumbs up!</em></p>
<p>Now if you've never gone through this pain, you may be wondering what this even serves as a replacement for?</p>
<p>Just imagine your Terraform applies failing each time, having to conjure up this command and... waiting/polling for the feature registration to complete before returning to Terraform to apply a new plan and continue where you left off...</p>
<img src="https://cdn.hashnode.com/uploads/covers/69da8f7ac8e5007ddbd46077/843179bb-f30e-45d9-9622-ca8f52cfeedd.gif" alt="" style="display:block;margin:0 auto" />

<p><em>If the text doesn't do it justice, a picture is worth 1000 words!</em>  </p>
<p>For the adventurous, this was the previous command you needed to remember to run (hopefully) outside of Terraform:</p>
<pre><code class="language-shell">az feature register --namespace Microsoft.Compute --name EncryptionAtHost
</code></pre>
<p>This created a jarring experience which in unscalable and command-wise easy to forget (100% guilty).</p>
<p>I'm ecstatic to report through this post we can now do our own feature registrations all in Terraform! Let's put at least this single esoteric command behind us that kept failing our runs, and keep our future deployments running smoothly 🫡.</p>
<p>To see a full example of provisioning an AKS cluster with disk encryption, check out the repo here: <a href="https://github.com/codycodescloud/terraform-aks-host-encryption">https://github.com/codycodescloud/terraform-aks-host-encryption</a></p>
<hr />
<h3>Takeaways, Thoughts, Miscellany</h3>
<p>While it's awesome to see this newly Terraform-able resource which enables encrypted AKS clusters to provision without any clever outside hacks, I'm actually curious to know:</p>
<ol>
<li><p>More about the <em>why</em> for features and this feature in particular continuing to exist in 2026, and...</p>
</li>
<li><p>What this means for feature registrations with regards to the typical Terraform CRUD lifecycle?</p>
</li>
</ol>
<p>For 1. Most times, I've seen features come up as "in preview" which are then GA'd and are no longer available to register. I'm curious to know if there are plans to GA this feature for AKS?</p>
<p>And this brings up a good point for 2., which is for the future IaC maintainer to ask: "what happens when Terraform is unable to register that provider on new AKS clusters because it may no longer exist?" From my perspective it's something that should be handled at the module level and using <code>count</code> or <code>for_each</code> with a <code>depends_on</code> that forces the dependency (but only if it exists!) This means we can easily configure whether or not we need the registration and use defaults to control its behavior, thus minimizing deployment errors going forward.</p>
<p>Well, I'd love to hear your thoughts about this and what else might be bouncing around in the noggin' of yours with regards to Terraform, Azure, and this slick new resource! Feel free to post in the comments or send me a message directly on channels in my profile. I can't wait to hear about your thoughts here!</p>
<img src="https://cdn.hashnode.com/uploads/covers/69da8f7ac8e5007ddbd46077/622876f2-e2a6-4e8f-8b4d-49c78c9aeead.gif" alt="" style="display:block;margin:0 auto" />

<p><em>Until next time, IaC cowboy</em> 🤠</p>
]]></content:encoded></item></channel></rss>