Create AWS shared credentials
Use aws configure to create an Access Credentials file with the default profile.
Example - Command output of aws
configure.
$ aws configure
AWS Access Key ID [None]: #AKIAIOSFODNN7EXAMPLE# 1
AWS Secret Access Key [None]: #wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY# 2
Default region name [None]: 3
Default output format [None]: #json# 4
1 The Access Key will be stored in ~/.aws/credentials.
2 The Secret Key will be stored in ~/.aws/credentials.
3 The Region does not need to be set. The user can press the Return key to skip this.
The Region will be stored in ~/.aws/config.
4 The Output Format will be stored in ~/.aws/config.
Note: For more information, see Configuring the AWS Command Line Interface on
Amazon.
To support multiple identities, AWS credential files can use Named Profiles.
Use aws configure --profile {profileName} to create an access credentials file with a named profile. Extra named profiles are appended to the ~/.aws/credentials.
Example - Command output of aws configure --profile
pool2.
$ aws configure --profile pool2
AWS Access Key ID [None]: AKIAIOSFODNN7EXAMPLE 1
AWS Secret Access Key [None]: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY 2
Default region name [None]: 3
Default output format [None]: json 4
1 The Access Key will be stored in ~/.aws/credentials.
2 The Secret Key will be stored in ~/.aws/credentials.
3 The Region does not need to be set. The user can press the Return key to skip this.
The Region will be stored in ~/.aws/config.
4 The Output Format will be stored in ~/.aws/config.
Example - Contents of the AWS credentials
file
(~/.aws/credentials).
[default]
aws_access_key_id = AKIAIOSFODNN7EXAMPLE
aws_secret_access_key = wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
[profile pool2] 1
aws_access_key_id = N67W90RKLCWOLPSKN8W8
aws_secret_access_key = RlfTDyqPg0WnY/PWdxMEe/gjuG7QRckynofRMwwR
1 The pool2 profile offers another set of Access Credentials for an S3 connection.
Example - Contents of the AWS
configuration file
(~/.aws/config).
[default]
output=json
[profile pool2]
output=text