
1 and 2 are to add environment variables
3 is directly from the credentials file to add the relevant configuration
4 through the aws configure configuration will be gradually added to the credentials file, the profile-name is default, meaning that if you do not indicate the profile, it will go to the default configuration, if you want to specify the profile name of the file you want to use in 3, you can use the following commands
aws ecr get-login-password --region us-east-1 --profile ********_PowerUserPlusRole | docker login --username AWS --password-stdin *********.dkr.ecr.us-east-1.amazonaws.comAll of the above is to add a temporary token, if you want to realize the automatic acquisition, you can implement the command 1, it will add the relevant settings in the config file, you also need to specify the corresponding profile, do not specify will go to the default
[default]
region = your-region
[profile PowerUserPlusRole-*********]
sso_start_url = sso_start_url_in_command_1
sso_region = sso_region_command_1
sso_account_id = *********
sso_role_name = PowerUserPlusRole
region = your-regionaws ecr get-login-password --region us-east-1 --profile ********_PowerUserPlusRole | docker login --username AWS --password-stdin *********.dkr.ecr.us-east-1.amazonaws.comNote: The configuration in configure will be used first, if not, the settings in credentials will be used.
aws sso login --profile PowerUserPlusRole-**********