AWS - Login
The login aws command authenticates with AWS using browser-based authentication. This generates short-lived credentials backed by your AWS Console session, without requiring the AWS CLI.
serverless login aws
Options
--aws-profile- AWS profile name to configure (defaults todefault)--regionor-r- AWS region to configure
Examples
Login and configure the default profile:
serverless login aws
Login with a specific profile and region:
serverless login aws --aws-profile myprofile --region us-west-2
How It Works
- The command opens your browser to the AWS sign-in page
- After authenticating with your AWS Console credentials, you're redirected back
- Temporary credentials are cached in
~/.aws/login/cache/ - Your AWS config file (
~/.aws/config) is updated with alogin_sessionreference
Note: Sessions expire after 12 hours. Run
serverless login awsagain to refresh your credentials.