...
- Set up the SSO session:
aws configure sso-session - Enter the required details:
- SSO session name: myyour-orgmemorable-sso-name (choose a memorable name)
- SSO start URL: https://d-9067c5bbc5.awsapps.com/start/#
- SSO region:
us-east-1 - SSO registration scopes:
sso:account:access
...
Provide the following information:
- SSO session name:
myyour-orgmemorable-sso-name(same as above) - SSO account ID: The 12-digit AWS account ID
- SSO role name: The role name you want to assume (e.g., Project-Admin, Project-Power-User, Project-Read-Only)
- CLI default client Region:
us-east-1(or your preferred region) - CLI default output format:
json Profile name [default_provided]: (choose a memorable name)
Manual Configuration (Alternative)
For multiple accounts/roles, you You can manually edit ~/.aws/config:
[sso-session myyour-orgmemorable-sso-name]
sso_region = us-east-1
sso_start_url = https://d-9067c5bbc5.awsapps.com/start/#
[profile dev-accountyour-memorable-profile-name-1]
sso_session = myyour-orgmemorable-sso-name
sso_account_id = 111122223333your-AWS-account's-numeric-accoun-ID
sso_role_name = your-role(e.g. Project-Power-User)
region = us-east-1
output = json
[profile prod-accountyour-memorable-profile-name-1]
sso_session = myyour-orgmemorable-sso-name
sso_account_id = 444455556666your-other-AWS-account's-numeric-account-ID
sso_role_name = your-role(e.g. Project-Read-Only)
region = us-east-1
output = json...
- Sign in to SSO:
This will open your browser for authentication (same process as portal login).aws sso login --profile devyour-profile-accountname - Run AWS CLI commands:
aws sts get-caller-identity --profile your-profile-name
If you do no do not want to specify --profile your-profile-name for every command:
export AWS_PROFILE=your-profile-name
Sign out when finished:
aws sso logout...
- Log into the AWS Access Portal using the steps above
- Select your desired AWS account and role
- In the account/role view, click "Command line or programmatic access"
- Choose your preferred option:
- Option 1: Copy and paste the temporary credentials as environment variables
- Option 2: Add the temporary credentials to your
~/.aws/credentialsfile - Option 3: Use the provided
aws configurecommands
...
- account
- Select 'Access keys' next to the role you want to use to access the AWS account
- Follow the instructions provided for the access key approach you want to use