<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>AWS on Jhooq</title><link>https://jhooq.com/tags/aws/</link><description>Recent content in AWS on Jhooq</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>Jhooq</copyright><lastBuildDate>Tue, 10 May 2022 00:00:00 +0000</lastBuildDate><atom:link href="https://jhooq.com/tags/aws/index.xml" rel="self" type="application/rss+xml"/><item><title>Terraform and AWS Credentials: Environment Variables, Shared Files and Profiles Compared (AWS Provider 6.71)</title><link>https://jhooq.com/terraform-aws-credentials-handling/</link><pubDate>Tue, 10 May 2022 00:00:00 +0000</pubDate><guid>https://jhooq.com/terraform-aws-credentials-handling/</guid><description>
&lt;h2 id="tldr"&gt;TL;DR&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The AWS provider reads credentials from six places, first match wins:&lt;/strong&gt; provider block arguments, environment variables, the shared credentials file, the shared config file, container credentials, then the EC2 instance profile. I confirmed the first three with Terraform 1.17.1 and AWS provider 6.71.0 on 2026-11-04.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Never put &lt;code&gt;access_key&lt;/code&gt; and &lt;code&gt;secret_key&lt;/code&gt; in the provider block.&lt;/strong&gt; They beat everything else, including the environment variables you set to override them, and they end up in Git.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Use &lt;code&gt;AWS_PROFILE&lt;/code&gt; or the environment variables on a laptop, and a role (container credentials or an instance profile) in CI.&lt;/strong&gt; AWS itself recommends temporary credentials over long-term access keys.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;shared_credentials_file&lt;/code&gt; is gone.&lt;/strong&gt; In provider 6.71.0 it fails with &lt;code&gt;Unsupported argument ... Did you mean &amp;quot;shared_credentials_files&amp;quot;?&lt;/code&gt;. The new argument takes a list.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Different error?&lt;/strong&gt; If Terraform complains about a variable instead, read &lt;a href="https://jhooq.com/value-for-undeclared-variable/"&gt;Value for undeclared variable&lt;/a&gt;; if you want the full secrets-with-Vault story, read &lt;a href="https://jhooq.com/hashi-vault-aws-secret-terraform/"&gt;Securing AWS secrets with HashiCorp Vault and Terraform&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;div class="video"&gt;
&lt;iframe src="https://www.youtube.com/embed/pw-g-9N5pLk?controls=1&amp;rel=0" loading="lazy"&gt;&lt;/iframe&gt;
&lt;/div&gt;
&lt;p&gt;Every Terraform project on AWS starts with the same question: where do the keys live? I first wrote this post in 2022 with three options (hard-coded, shared file, environment variables). The options are still the same, but the provider has changed underneath them, so on 2026-11-04 I re-ran all of it. This version shows the real precedence, the real error messages, and what I would pick today.&lt;/p&gt;</description></item></channel></rss>