You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

@aws-sdk/credential-provider-imds

Package Overview
Dependencies
Maintainers
5
Versions
140
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-sdk/credential-provider-imds

AWS credential provider that sources credentials from the EC2 instance metadata service and ECS container metadata service


Version published
Weekly downloads
3.7M
decreased by-2.13%
Maintainers
5
Install size
459 kB
Created
Weekly downloads
 

Package description

What is @aws-sdk/credential-provider-imds?

@aws-sdk/credential-provider-imds is a part of the AWS SDK for JavaScript. It provides a way to retrieve AWS credentials from the Instance Metadata Service (IMDS) on Amazon EC2 instances. This is particularly useful for applications running on EC2 instances that need to interact with other AWS services securely.

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

Retrieve Credentials from IMDS

This feature allows you to retrieve AWS credentials from the Instance Metadata Service (IMDS) on an EC2 instance. The code sample demonstrates how to use these credentials to make a call to the AWS STS service to get the caller identity.

const { fromInstanceMetadata } = require('@aws-sdk/credential-provider-imds');
const { STSClient, GetCallerIdentityCommand } = require('@aws-sdk/client-sts');

(async () => {
  const client = new STSClient({
    credentials: fromInstanceMetadata(),
  });
  const command = new GetCallerIdentityCommand({});
  const response = await client.send(command);
  console.log(response);
})();

Handle IMDS Timeout

This feature allows you to specify a timeout for the IMDS request. The code sample demonstrates how to set a 1-second timeout for retrieving credentials from IMDS and handle any potential errors.

const { fromInstanceMetadata } = require('@aws-sdk/credential-provider-imds');
const { STSClient, GetCallerIdentityCommand } = require('@aws-sdk/client-sts');

(async () => {
  const client = new STSClient({
    credentials: fromInstanceMetadata({ timeout: 1000 }), // 1 second timeout
  });
  const command = new GetCallerIdentityCommand({});
  try {
    const response = await client.send(command);
    console.log(response);
  } catch (error) {
    console.error('Error retrieving credentials:', error);
  }
})();

Other packages similar to @aws-sdk/credential-provider-imds

Changelog

Source

3.374.0 (2023-07-20)

Bug Fixes

  • packages: fix migrated package imports (#4990) (d800f78)

Features

  • client-codecatalyst: This release adds support for updating and deleting spaces and projects in Amazon CodeCatalyst. It also adds support for creating, getting, and deleting source repositories in CodeCatalyst projects. (05a9f89)
  • client-connectcases: This release adds the ability to assign a case to a queue or user. (f47d6f4)
  • client-lex-models-v2: This release updates type for Channel field in SessionSpecification and UtteranceSpecification (1f77d0a)
  • client-route53resolver: This release adds support for Route 53 On Outposts, a new feature that allows customers to run Route 53 Resolver and Resolver endpoints locally on their Outposts. (8acc64c)
  • client-s3: Improve performance of S3 clients by simplifying and optimizing endpoint resolution. (72eb598)
  • client-sagemaker-featurestore-runtime: Cross account support for SageMaker Feature Store (b0593ab)
  • client-sagemaker: Cross account support for SageMaker Feature Store (e4918c1)
  • client-securitylake: Adding support for Tags on Create and Resource Tagging API. (596636d)
  • client-transcribe: Added API argument --toxicity-detection to startTranscriptionJob API, which allows users to view toxicity scores of submitted audio. (9e7552a)
  • smithy-client: update client defaults provider (830cb06)

Readme

Source

@aws-sdk/credential-provider-imds

NPM version NPM downloads

An internal package

Usage

You probably shouldn't, at least directly. Please use @aws-sdk/credential-providers instead.

Keywords

FAQs

Package last updated on 20 Jul 2023

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc