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

@aws-sdk/credential-providers

Package Overview
Dependencies
Maintainers
5
Versions
346
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-sdk/credential-providers

A collection of credential providers, without requiring service clients like STS, Cognito

  • 3.616.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5.5M
increased by9.48%
Maintainers
5
Weekly downloads
 
Created

What is @aws-sdk/credential-providers?

The @aws-sdk/credential-providers package provides a set of functions to retrieve AWS credentials from various sources. It is part of the AWS SDK for JavaScript (v3) and is designed to work seamlessly with other @aws-sdk packages. It allows developers to obtain credentials from sources like environment variables, AWS configuration files, and EC2 instance metadata, among others.

What are @aws-sdk/credential-providers's main functionalities?

Environment Credentials

This feature allows you to create a credentials provider that will read AWS credentials from environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and optionally AWS_SESSION_TOKEN).

const { fromEnv } = require('@aws-sdk/credential-providers');
const credentials = fromEnv();

Configuration File Credentials

This feature enables you to create a credentials provider that will read AWS credentials from a shared AWS configuration file (typically located at ~/.aws/credentials). You can specify a profile to use.

const { fromIni } = require('@aws-sdk/credential-providers');
const credentials = fromIni({ profile: 'my-profile' });

EC2 Instance Metadata Credentials

This feature provides a credentials provider that retrieves AWS credentials from the EC2 instance metadata service. It is useful when running code on an EC2 instance with an attached IAM role.

const { fromInstanceMetadata } = require('@aws-sdk/credential-providers');
const credentials = fromInstanceMetadata();

Web Identity Token File Credentials

This feature is for creating a credentials provider that can assume an IAM role by using a web identity token file, which is useful in Kubernetes environments that use AWS IAM Roles for Service Accounts (IRSA).

const { fromTokenFile } = require('@aws-sdk/credential-providers');
const credentials = fromTokenFile({
  roleArn: 'arn:aws:iam::123456789012:role/my-role',
  roleSessionName: 'my-session-name'
});

SSO Credentials

This feature allows you to create a credentials provider that retrieves AWS credentials using AWS Single Sign-On (SSO). This is useful for developers who use AWS SSO for authentication.

const { fromSSO } = require('@aws-sdk/credential-providers');
const credentials = fromSSO({ profile: 'my-sso-profile' });

Other packages similar to @aws-sdk/credential-providers

Keywords

FAQs

Package last updated on 18 Jul 2024

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