Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

serverless-better-credentials

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

serverless-better-credentials

Better AWS credentials resolution plugin for serverless

  • 1.1.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
34K
increased by95.33%
Maintainers
1
Weekly downloads
 
Created
Source

Serverless Better Credentials

The Serverless Better Credentials plugin replaces the existing AWS credential resolution mechanism in the Serverless Framework with an extended version that:

It is designed to be a drop-in replacement; respecting the current credentials resolution order and extensions already provided by the Serverless Framework.

Usage

  1. Install
npm install --dev serverless-better-credentials
# or
yarn add --dev serverless-better-credentials
  1. Configure

Add the following to your serverless.yml:

plugins:
  - serverless-better-credentials # as the first plugin
  # - ... other plugins

AWS Single Sign On (SSO) Support

AWS SSO profiles configured to work with the AWS CLI should "just work" when this plugin is enabled. This includes prompting and attempting to automatically open the SSO authorization page in your default browser when the credentials require refreshing.

Full details about how to configure AWS SSO can be found in the AWS CLI documentation.

Take note that if you are using SSO with the approach AWS document (a shared .aws/config file) you'll also need to set the AWS_SDK_LOAD_CONFIG enviornment value to something truthy (e.g. AWS_SDK_LOAD_CONFIG=1), as described in the AWS SDK documentation.

Other Credential Resolution

Credentials are resolved in the same order the Serverless Framework currently uses. This order is:

  • from profile: cli flag --aws-profile
  • from profile: env AWS_${STAGE}_PROFILE
  • from env - AWS_${STAGE}_X
  • from profile - AWS_PROFILE
  • from env - AWS_X
  • from profile - serverless.yml > provider.profile (unless --aws-profile is specified)
  • from config - serverless.yml > provider.credentials
  • from profile - AWS_DEFAULT_PROFILE || default

Where:

  • profile credentials resolve against the matching [profile_name] configuration:
  • env credentials resolve as EnvironmentCredentials (i.e. from the running process environment)
  • config credentials resolve directly as Credentials (i.e. from an explicitly set key id and secret)

Help and Support

If you have an issue, suggestion, or want to contribute, please open an issue or create a pull request and I'll take a look.

Keywords

FAQs

Package last updated on 26 Apr 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc