Giter Club home page Giter Club logo

aws-sdk-config-loader's Introduction

aws-sdk-config-loader

NPM version NPM downloads Build Status Coverage Status DevDependency Status License

AWS config file loader for CLI tools.

this library load ~/.aws/config that aws-sdk-js is not supported.

Installation

npm install aws-sdk-config-loader aws-sdk

Usage

API Document: https://moqada.github.io/aws-sdk-config-loader/

put following ~/.aws/credentials

[default]
aws_access_key_id = default_key_id
aws_secret_access_key = default_secret_key
[foo]
aws_access_key_id = foo_key_id
aws_secret_access_key = foo_secret_key

put following ~/.aws/config.

[default]
region = ap-northeast-1
[foo]
region = us-east-1
import AWS from 'aws-sdk';
import loader from 'aws-sdk-config-loader';

loader(AWS);
// AWS.config.region === 'ap-northeast-1'
// AWS.config.credentials.accessKeyId = 'default_key_id'
// AWS.config.credentials.secretAccessKey = 'default_secret_key'

// export AWS_PROFILE=foo
loader(AWS);
// AWS.config.region === 'us-east-1'
// AWS.config.credentials.accessKeyId = 'foo_key_id'
// AWS.config.credentials.secretAccessKey = 'foo_secret_key'

// export AWS_CONFIG_FILE=/path/to/config
loader(AWS);
// set AWS.config from /path/to/config

loader(AWS, {profile: 'foo'})
// AWS.config.region === 'us-east-1'
// AWS.config.credentials.accessKeyId = 'foo_key_id'
// AWS.config.credentials.secretAccessKey = 'foo_secret_key'

loader(AWS, {profile: 'foo', noReflectCredentials: true})
// AWS.config.region === 'us-east-1'
// AWS.config.credentials.accessKeyId = 'default_key_id'
// AWS.config.credentials.secretAccessKey = 'default_secret_key'

aws-sdk-config-loader's People

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

willist poeblu

aws-sdk-config-loader's Issues

Mention AWS_SDK_LOAD_CONFIG environment variable in readme

I've been using this library but recently discovered that the aws-sdk can actually be coerced into loading config itself by setting an environment variable: AWS_SDK_LOAD_CONFIG=true. It'd be great to put a note about this on the readme.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.