Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I set the name of the default profile in AWS CLI?

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 have two profiles and I want to switch between profiles using the AWS_DEFAULT_PROFILE environment variable.

like image 514
TheRookierLearner Avatar asked Jun 23 '15 20:06

TheRookierLearner


People also ask

How do I change the default profile in AWS CLI?

You just switch to the profile you want (for ex: in Linux use: export AWS_DEFAULT_PROFILE=MyProfile ) and then switch back to the default profile using export AWS_DEFAULT_PROFILE=default .

How do I create a named profile in AWS CLI?

You can configure a named profile using the --profile argument. If your config file does not exist (the default location is ~/. aws/config ), the AWS CLI will create it for you. To keep an existing value, hit enter when prompted for the value.

Where is my aws profile name?

To obtain access keys for a profile To get your access keys (consisting of an access key ID and secret access key), go to the IAM console at https://console.aws.amazon.com/iam/ . Choose Users from the navigation bar and then choose your AWS user name (not the check box).

What is the default CLI output format in aws?

JSON is the default output format of the AWS CLI.


1 Answers

I have multiple profiles too, I use AWS_DEFAULT_PROFILE to switch back and forth. However, I've named each profile something descriptive, like aws-engineering and aws-production. Then, I can use set AWS_DEFAULT_PROFILE=aws-engineering and I'm good to go.

I have no DEFAULT profile specified in my ~/.aws/config, this was intentional so that I always explicitly have to choose which environment I'm working on.

like image 109
ijustneedanswers Avatar answered Sep 16 '22 14:09

ijustneedanswers