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

aws-config

Package Overview
Dependencies
Maintainers
2
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aws-config

Encapsulates boilerplate AWS config setup

  • 1.4.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5.3K
decreased by-12.6%
Maintainers
2
Weekly downloads
 
Created
Source

NPM Version NPM Downloads Build Status Test Coverage

Reduce boilerplate code when configuring the AWS Node.js SDK. http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/node-configuring.html

Takes care of the following:

  • Handles corporate proxy via https-proxy-agent if HTTPS_PROXY environment variable exists.
  • Utilize a named profile from .aws/credentials file if profile option specified
  • Support AWS_TIMEOUT environment variable to enforce a maximum timeout for all AWS SDK operations
  • Honors the AWS_DEFAULT_PROFILE and AWS_DEFAULT_REGION environment variables used by the AWS CLI.
  • Honors the AWS_WEB_IDENTITY_TOKEN_FILE environment variable used for web token based authentication for kubernetes service accounts

Installation

npm install aws-config

Options

awsConfig({
  region: 'us-east-1'                  // explicitly set AWS region
  sslEnabled: true,                    // override whether SSL is enabled
  maxRetries: 3,                       // override the number of retries for a request
  accessKeyId: 'your_aws_access_key',  // can omit access key and secret key
  secretAccessKey: 'your_secret_key'   // if relying on a profile or IAM
  profile: 'profile_name',             // name of profile from ~/.aws/credentials
  timeout: 15000                       // optional timeout in ms. Will use AWS_TIMEOUT
});

Usage

var AWS = require('aws-sdk');
var awsConfig = require('aws-config');

// demonstrating different sample usage at the individual service level
var s3 = new AWS.S3(awsConfig({accessKeyId: '123', secretAccessKey: 'abc'}));
var ec2 = new AWS.EC2(awsConfig({profile: 'aws-profile-name'}));
var dynamo = new AWS.DynamoDB(awsConfig({timeout: 5000}));

// you can also set the AWS config globally and use empty constructors on
// individual services.
AWS.config = awsConfig();

var s3 = new AWS.S3();

Keywords

FAQs

Package last updated on 27 Jun 2020

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