• Documentation
  • Pricing
© 2026 Serverless, Inc. All rights reserved.

Framework

  • Overview
  • Documentation
  • Plugins360
  • Pricing

Learn

  • Blog
  • GuidesUpdated
  • Examples240
  • Courses

Resources

  • Support
  • Security
  • Trust Center
  • Status

Community

  • Slack
  • GitHub47k
  • Forum
  • Meetups

Company

  • About
  • Careers
  • Contact
  • Partners

Legal

  • Terms of Service
  • Privacy Policy
  • Trademark
  • DMCA
Serverless Framework Logo

Serverless Framework

Intro
SetupUpgrading To V4ConceptsTutorialAWS CredentialsLicense KeysVerifying Downloads
DeployingPackagingBuildingTestingDev ModeServicesFunctions
OverviewHTTP (API Gateway v2)REST (API Gateway v1)ActiveMQApplication Load BalancerAlexa SkillAlexa Smart HomeCloudWatch EventCloudWatch LogCloudFrontCognito User PoolEventBridge EventIoTIoT Fleet ProvisioningKafkaKinesis & DynamoDBMSKRabbitMQS3ScheduleSNSSQSWebsocket
Layers
OverviewTroubleshooting
Managed InstancesWeb Apps (Lambda Web Functions)Sandboxes (Lambda MicroVMs)MCP ServersAlertsVersion PruningDomainsIAM Function PermissionsParameters
OverviewSelf-reference serverless.ymlServerless CoreEnvironment VariablesCLI OptionsExternal YAML/JSON FilesJavascript propertiesGitDoppler
OverviewS3 ObjectsSSM Parameter Store & Secrets ManagerCloudFormation Stack Outputs
OverviewVaultTerraform State Output
ResourcesComposing ServicesDeployment BucketStateAgent SkillsPython support
OverviewRuntimeGatewayMemoryBrowserCode InterpreterDev Mode
API Gateway Proxy
OverviewGeneral ConfigurationAuthenticationAPI KeysData SourcesResolversPipeline FunctionsSubstitutionsCachingDelta SyncCustom DomainWAFCLI Commands
Deploying SAM/CFN TemplatesWorkflow Tips
OverviewCreating PluginsCLI OutputCustom CommandsCustom VariablesExtending the Configuration schemaExtending and overriding configuration
OverviewDashboardAxiom
Overviewagent docsagent inspectagent setupagent skills installagent skills list / readdeploydeploy functiondeploy listdevdiffinfoinvokeinvoke localloginlogin awslogin aws ssologsmetricspackageplugin installplugin uninstallprintprunereconcileremoverollbackrollback functionusage
OverviewConcepts
OverviewMetricsTracesTroubleshoot
OverviewNode.jsPython
OutputsProviders
OverviewBranch DeploymentsPreview DeploymentsCustom ScriptsTestingPrivate PackagesNotificationsMono ReposDeploy in your own CI/CDBest PracticesTroubleshootingFAQ
OverviewSetupToolsAWS Integration
Serverless.yml Reference
Examples and TutorialsConfiguration Validation
  1. CLI Reference
  2. Login AWS

serverless login aws

serverless login aws signs you in to AWS in the browser with your AWS Management Console credentials (root user, IAM user or federated identity) and configures an AWS profile with short-lived credentials, the same way aws login does in the AWS CLI. Use it when you have no access keys on this machine; use serverless login aws sso if you sign in through IAM Identity Center, and serverless login for the Serverless Framework Dashboard.

serverless login aws

The command needs a terminal and a browser on the same machine, and works inside or outside a service directory. It doesn't need a Dashboard sign-in.

Options

serverless login aws accepts these options:

OptionAliasValueDefaultRequiredDescription
--aws-profilestringdefaultNoAWS profile to configure in ~/.aws/config.
--region-rRegion codeAWS_REGION, else us-east-1NoAWS Region of the sign-in endpoint. When given, it's also saved as the profile's region; when not, a region already set stays, and a profile without one gets this Region.

The command also accepts --verbose, --debug and --help (-h).

Prerequisites for serverless login aws

  • The IAM identity you sign in with has the SignInLocalDevelopmentAccess AWS managed policy, or a policy that allows the same AWS Sign-In actions. A root user needs none. See Login for AWS local development using console credentials.
  • A terminal: without one (CI, a pipe, an AI agent) the command stops with The `login aws` command requires an interactive environment (TTY) to authenticate. In CI, give the Framework AWS credentials another way, such as the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables or a resolver: see which credentials a deploy uses.

Files serverless login aws writes

After you sign in, the command writes two files:

  • The credential cache: ~/.aws/login/cache/<hash>.json, readable only by your user. It holds the temporary credentials and the refresh token, in the AWS CLI's format.
  • The AWS config file: ~/.aws/config, or the file AWS_CONFIG_FILE names. In the profile's section ([default] or [profile <name>]) it sets login_session to your identity's ARN and, as described for --region, region:
[profile my-dev]
login_session = arn:aws:iam::123456789012:user/jane
region = us-east-1

The command doesn't write ~/.aws/credentials or the Framework's ~/.serverlessrc.

Use the profile with the Framework

The Framework reads the profile through the AWS SDK. A profile other than default must be selected, as for any profile: with --aws-profile, provider.profile in serverless.yml, or AWS_PROFILE. See which credentials a deploy uses.

serverless deploy --aws-profile my-dev

Use a profile that holds no access keys, role or SSO settings: the AWS SDK uses those before login_session.

The AWS CLI and SDKs refresh the cached credentials every 15 minutes. The session lasts up to the session duration of the IAM principal, at most 12 hours; after that, run serverless login aws again.

Run serverless login aws again

Running the command again for the same identity refreshes the credential cache and rewrites the same values. If the profile already uses a different login_session, the command asks before it overwrites it:

Profile my-dev is already configured to use session arn:aws:iam::123456789012:user/jane.
Do you want to overwrite it to use arn:aws:iam::123456789012:user/admin instead?

Answering No keeps the profile as it is; the new credentials are still cached.

Output of serverless login aws

The command opens the sign-in page in your default browser (with --verbose it also prints the URL; if the browser can't be opened, it prints the URL to copy) and waits up to 5 minutes. On success it prints:

✔ Successfully logged in. Saved session arn:aws:iam::123456789012:user/jane to profile "my-dev".

After 5 minutes without a sign-in it stops with Login timed out. Please try again.

Examples

Configure the default profile

serverless login aws

Configure a named profile and Region

serverless login aws --aws-profile my-dev --region eu-central-1

Related commands

  • serverless login aws sso signs in through IAM Identity Center.
  • serverless login signs in to the Serverless Framework Dashboard.
  • AWS credentials covers every other way to give the Framework AWS credentials.
Edit this page
Prev loginNextlogin aws sso

Contents

  • serverless login aws
  • Options
  • Prerequisites for serverless login aws
  • Files serverless login aws writes
  • Use the profile with the Framework
  • Run serverless login aws again
  • Output of serverless login aws
  • Examples
  • Configure the default profile
  • Configure a named profile and Region
  • Related commands

Related

GuidesPluginsExamplesSlack CommunitySupport