- Published on
Set up AWS CLI SSO login
- Authors
- Name
- Gene Zhang
Steps to configure the AWS CLI to retrieve credentials automatically using the aws configure sso.
- Add a new profile to the
~/.aws/config
file:
[profile dev]
sso_start_url = https://xxx.awsapps.com/start
sso_region = us-west-2
sso_account_id = <your_account_id>
sso_role_name = <your_role_name>
region = us-west-2
output = json
- SSO login with the profile:
aws sso login --profile dev
- Run commands with
--profile
:
aws s3 ls --profile workload-dev
or set the profile as an environment variable:
export AWS_PROFILE=dev
aws s3 ls