Explore Courses Blog Tutorials Interview Questions
0 votes
in AWS by (12.9k points)

When I give the command aws config list, I get the following output for the default profile:

Name          Value             Type    Location

----          -----             ----    --------

profile       <not set>         None    None

However, when I give the command for a named profile, I get a profile name

$ aws configure list --profile MyProfile

Name           Value          Type      Location

----           -----          ----      --------

profile        MyProfile      manual    --profile

I have tried aws configure set profile Default to name the default profile as Default by reading the 'set' CLI command, I also tried AWS configure set StoreAs Default because I thought that's what's the variable is named after I read this page. I want to do this because I want to have two profiles and I want to switch between profiles using the AWS_Default_Profile environment variable.

1 Answer

0 votes
by (18.2k points)

You can use AWS_DEFAULT_PROFILE to switch between your multiple accounts by setting the default profile in your environment with CLI or SDK.

For CLI, you can use the following commands as per your OS:


set AWS_DEFAULT_PROFILE= <profile name>

Linux, Unix or MacOS

export AWS_DEFAULT_PROFILE = <profile name>

For SDK, you will have to set the AWS_PROFILE environment variable to the profile you want to use.

Learn more about AWS by going through AWS course and master this trending technology.

Related questions

Want to get 50% Hike on your Salary?

Learn how we helped 50,000+ professionals like you !

Browse Categories