AWS configure sso profile and login
A quick note for setting up an AWS SSO profile and logging in explicitly with the intended profile name.
AWSSSOAWS CLIProfile
Problem
You need to configure an AWS SSO profile once, then log in with the exact profile name before running AWS CLI commands.
Why it happens
The AWS CLI separates profile configuration from session login. If the profile is not created cleanly or the wrong profile name is used later, commands will fail or use a different credential path than expected.
Fix
Create the SSO profile first with `aws configure sso --profile ...`, then log in with `aws sso login --profile ...`, and verify the active identity.
Commands
bash
aws configure sso --profile sandbox-sso
aws sso login --profile sandbox-sso
AWS_PROFILE=sandbox-sso aws sts get-caller-identityWhen to use
- Local development laptops
- AWS CLI access with IAM Identity Center
- Cases where you want one explicit named profile per account or role
When not to use
- Non-interactive automation that should use a role, workload identity, or machine credential flow
Notes
- Use the same profile name consistently in both commands
- `--profil` is a typo; the correct flag is `--profile`
- Verifying with `aws sts get-caller-identity` is the fastest sanity check