Member-only story

AWS SSO Config

Dheeraj kumar
Jul 11, 2024

Locate Your AWS Config File:

  • The AWS config file is usually located at ~/.aws/config.

Edit the Config File:

  • Open the config file in a text editor.
  • Add entries for each AWS account you want to access. The entries should look like this:
[default]
region=ap-south-1
output=json

#sso
[sso-session sso]
sso_start_url = https://abc.awsapps.com/start
sso_region = ap-southeast-1
sso_registration_scopes = sso:account:access

#dan
[profile dev-dan]
sso_session = sso
sso_account_id = 24209280129
sso_role_name = Dev-Admin

[profile stg-dan]
sso_session = sso
sso_account_id = 62329010201
sso_role_name = STG-Admin

Run the below command:

aws sso login --sso-session sso

Note: It will prompt you to login via AWS. Follow the steps and authenticate

Once authenticated, Run AWS commands:

aws s3 ls --profile dev-dan
aws s3 ls --profile stg-dan

--

--

Dheeraj kumar
Dheeraj kumar

Written by Dheeraj kumar

A DevOps/MLOps/GitOps/SecOps who is passionate about Autom@tion.

No responses yet