<p>Can I put environment variables to aws credentials file and let <code>aws configure</code> recognize and parse the file? I have tried below. Look like the variable is not parsed by <code>aws configure</code>.</p>
<pre><code>[default]
aws_access_key_id=${TEST_KEY_ID}
aws_secret_access_key=${TEST_SECRET_KEY}
[profile2]
aws_access_key_id=${TEST2_KEY_ID}
aws_secret_access_key=${TEST2_SECRET_KEY}
</code></pre>
<p>If I cannot, how can I create an AWS credentials file in a Kubernetes pod? I know we can generate a file using configMap. But I do not want to put key id and secret key in configMap directly since all Kubernetes code will be stored in git repository.</p>

user389955
<p>I would suggest you create a new Kubernetes service account and then map it to a specific IAM role.</p>
<p>Reference: <a href="https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html</a></p>
