docs/sf/providers/aws/cli-reference/login-aws-sso.md
The login aws sso command authenticates with AWS using SSO (IAM Identity Center). This is for users who have configured SSO via aws configure sso and want the Serverless Framework to use their SSO session.
serverless login aws sso
--aws-profile - AWS profile name containing SSO configuration (defaults to default)--sso-session - SSO session name to use (if profile references a session)Before using this command, you must have SSO configured in your ~/.aws/config. Run:
aws configure sso
This creates the necessary [sso-session] and [profile] entries.
Login using the default profile's SSO configuration:
serverless login aws sso
Login using a specific profile:
serverless login aws sso --aws-profile mycompany-dev
~/.aws/config~/.aws/sso/cache/Modern format (recommended):
[sso-session mycompany]
sso_start_url = https://mycompany.awsapps.com/start
sso_region = us-east-1
sso_registration_scopes = sso:account:access
[profile mycompany-dev]
sso_session = mycompany
sso_account_id = 123456789012
sso_role_name = DeveloperAccess
region = us-west-2
Legacy format:
[profile mycompany-dev]
sso_start_url = https://mycompany.awsapps.com/start
sso_region = us-east-1
sso_account_id = 123456789012
sso_role_name = DeveloperAccess
region = us-west-2
The Serverless Framework SSO login uses the same token cache (~/.aws/sso/cache/) as AWS CLI. This means: