<?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" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Uzair Khan on Medium]]></title>
        <description><![CDATA[Stories by Uzair Khan on Medium]]></description>
        <link>https://medium.com/@iamblogger?source=rss-5f1176309f94------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*RXIzDlcBvzvHdGP1v3O-MQ.jpeg</url>
            <title>Stories by Uzair Khan on Medium</title>
            <link>https://medium.com/@iamblogger?source=rss-5f1176309f94------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 11:41:51 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@iamblogger/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Manage AWS Credentials like a Pro]]></title>
            <link>https://medium.com/@iamblogger/manage-aws-credentials-like-a-pro-b2432d2e90ac?source=rss-5f1176309f94------2</link>
            <guid isPermaLink="false">https://medium.com/p/b2432d2e90ac</guid>
            <category><![CDATA[amazon-aws-problems]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[aws-credentials]]></category>
            <category><![CDATA[aws-cli]]></category>
            <dc:creator><![CDATA[Uzair Khan]]></dc:creator>
            <pubDate>Wed, 17 Jun 2020 09:45:44 GMT</pubDate>
            <atom:updated>2020-06-17T10:16:30.524Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5j5Smd2lzgilsnDt0Wz4sQ.png" /></figure><p>Setting AWS Credentials is the first step in the Universe of AWS, for developers. Although configuring AWS credentials is not very is difficult if you have a single role and single account, But if you have multiple roles, multiple accounts or both then this easy task becomes frantic for you.</p><p>There are multiple ways to manage AWS Credentials. You might know a few of them already, but you should know all of them.</p><h3>First Time Configuring AWS Credentials</h3><p>When you execute aws configure command without any argument, you’ll be configuring aws credentials as your default profile.</p><pre>$ aws configure<br>AWS Access Key ID [None]: AAABBBCCCDDDEEEFFFGG<br>AWS Secret Access Key [None]: aaabbbcccdddeeefffggghhhiiijjjkkkl<br>Default region name [None]: us-east-1<br>Default output format [None]: json</pre><ul><li>[None] — This indicates that you don’t have any existing access-key-id/secret-access-key setup on your system for default profile, and will prompt you for new values.</li><li>Region Name — This is optional. If you leave this empty, you should specify region in all your AWS CLI commands using –region parameter, else you’ll get an error message.</li><li>Output — This is optional. If you leave this empty, the output of all AWS CLI will be in json format. Available output options are: json, text, table</li></ul><p>When you execute AWS configure for the first time, it will create .aws directory and two files credentials and config if it doesn’t already exits.</p><p><strong>Linux or macOS</strong></p><pre>$ <strong>ls  ~/.aws</strong></pre><p><strong>Windows</strong></p><pre>C:\&gt; <strong>dir &quot;%UserProfile%\.aws&quot;</strong></pre><p>.aws/credentials — This will contain your access_key_id and secret_access_key</p><p>Bonus Tip: To save you time you can pin this file on your taskbar.</p><p>.aws/config — This will contain the non-credential configuration information such as region and output</p><h3>Create Multiple AWS Profiles</h3><p>If you have multiple AWS accounts you’ve to keep changing the values of access_key_id and secret_access_key, which is not practical.</p><p>In your credentials file you can create multiple profiles to switch fastly to execute aws cli command on a specific profile.</p><pre>[dev]<br>aws_access_key_id = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<br>aws_secret_access_key = vvvvvvvvvvvvvvvvvvvvvvv<br>aws_session_token = aaaaaaaaaaaaaaaaasssssssssssssssssss</pre><pre>[prod]<br>aws_access_key_id = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<br>aws_secret_access_key = vvvvvvvvvvvvvvvvvvvvvvv<br>aws_session_token = aaaaaaaaaaaaaaaaasssssssssssssssssss</pre><p>After setting these profile now we can execute any AWS cli command on desired profile</p><pre>aws s3 ls --profile dev</pre><p>Now you can switch AWS profile quickly.</p><p><strong>Linux or macOS</strong></p><pre>export AWS_PROFILE=&quot;dev&quot;</pre><p><strong>Windows</strong></p><pre>set AWS_PROFILE=dev</pre><p>Or, you can simply unset the AWS_PROFILE environment variable, which will then automatically start using the default profile.</p><pre>unset AWS_PROFILE</pre><p>And you can also set region and output as well</p><pre>[profile dev]<br>region = us-east-1<br>[profile prod]<br>region = us-west-2</pre><p>If you don’t have Single Sign-On on your account then you can get your AWS Access Key ID and AWS Secret Access Key from AWS console IAM service and execute the following command to get session token.</p><pre>$ aws sts get-session-token --duration-seconds 129600</pre><p>In my next article, I will describe how to use <a href="https://github.com/Versent/saml2aws">saml2aws</a> to manage AWS credentials.</p><p><em>Thanks for reading this article! Leave a comment below if you have any questions.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b2432d2e90ac" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>