<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Terraform on Nimbus</title><link>https://k-s-pavan-kumar.github.io/hugo-nimbus/tags/terraform/</link><description>Recent content in Terraform on Nimbus</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Wed, 15 Feb 2023 10:00:00 -0700</lastBuildDate><atom:link href="https://k-s-pavan-kumar.github.io/hugo-nimbus/tags/terraform/index.xml" rel="self" type="application/rss+xml"/><item><title>Terraform State Management: Lessons from Production</title><link>https://k-s-pavan-kumar.github.io/hugo-nimbus/blog/post-2/</link><pubDate>Wed, 15 Feb 2023 10:00:00 -0700</pubDate><guid>https://k-s-pavan-kumar.github.io/hugo-nimbus/blog/post-2/</guid><description>&lt;p&gt;Local Terraform state works fine for a weekend project. It falls apart the
moment a second engineer runs &lt;code&gt;terraform apply&lt;/code&gt; against the same
infrastructure. Here&amp;rsquo;s the setup we settled on after a state file conflict
took down a staging environment for an afternoon.&lt;/p&gt;







&lt;div class="alert alert-warning"&gt;
 &lt;div class="flex items-start"&gt;
 &lt;div class="flex-shrink-0"&gt;
 &lt;svg class="h-5 w-5 mt-0.5" fill="none" viewBox="0 0 24 24" stroke="currentColor"&gt;
 &lt;path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 15.5c-.77.833.192 2.5 1.732 2.5z" /&gt;
 &lt;/svg&gt;
 &lt;/div&gt;
 &lt;div class="ml-3 flex-1"&gt;
 
 &lt;h4 class="text-sm font-semibold mb-1"&gt;State files contain secrets&lt;/h4&gt;
 
 &lt;div class="text-sm"&gt;
 Terraform state can include plaintext values for anything marked &lt;code&gt;sensitive&lt;/code&gt;
in your provider — database passwords, API keys, TLS private keys. Treat
your state backend&amp;rsquo;s access controls with the same care as a secrets
manager, not like a build artifact.
 &lt;/div&gt;
 &lt;/div&gt;
 &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id="move-to-a-remote-backend"&gt;Move to a remote backend&lt;/h2&gt;
&lt;p&gt;A local &lt;code&gt;terraform.tfstate&lt;/code&gt; file has no locking and no history. The fix is
a remote backend with state locking built in:&lt;/p&gt;</description></item></channel></rss>