# aws-config

> Encapsulates boilerplate AWS config setup

Latest version **1.4.0** (published 2020-06-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install aws-config
pnpm add aws-config
yarn add aws-config
bun add aws-config
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.4.0 |
| Published | 2020-06-27 |
| First published | 2015-10-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 6.7 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 10 |
| Author | David Von Lehman |
| Maintainers | aerobatic, dvonlehman |
| Keywords | aws-sdk, config |

## Links

- npm: https://www.npmjs.com/package/aws-config
- Repository: https://github.com/aerobatic/aws-config
- Homepage: https://github.com/aerobatic/aws-config#readme
- Issues: https://github.com/aerobatic/aws-config/issues
- npm.io page: https://npm.io/package/aws-config

## Dependencies (3)

- [is-ec2](https://npm.io/package/is-ec2.md) ^1.0.2
- [aws-sdk](https://npm.io/package/aws-sdk.md) ^2.702.0
- [https-proxy-agent](https://npm.io/package/https-proxy-agent.md) ^5.0.0

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 1.4.0 (latest) — 2020-06-27
- 1.3.2 — 2019-03-29
- 1.3.1 — 2019-02-13
- 1.3.0 — 2019-02-13
- 1.2.0 — 2018-06-14
- 1.1.4 — 2018-03-12
- 1.1.3 — 2017-02-23
- 1.1.2 — 2017-02-16
- 1.1.1 — 2017-02-16
- 1.1.0 — 2016-04-25
- 1.0.7 — 2016-02-29
- 1.0.6 — 2016-02-29
- 1.0.5 — 2016-02-29
- 1.0.4 — 2015-12-29
- 1.0.3 — 2015-10-30
- … 3 more at https://npm.io/package/aws-config/versions

## README

[![NPM Version][npm-image]][npm-url]
[![NPM Downloads][downloads-image]][downloads-url]
[![Build Status][travis-image]][travis-url]
[![Test Coverage][coveralls-image]][coveralls-url]

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](https://www.npmjs.com/package/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](http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html#cli-environment).
* Honors the `AWS_WEB_IDENTITY_TOKEN_FILE` environment variable used for web token based authentication for [kubernetes service accounts](https://aws.amazon.com/blogs/opensource/introducing-fine-grained-iam-roles-service-accounts/)

## Installation

~~~sh
npm install aws-config
~~~

### Options

~~~js
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

~~~js
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();
~~~

[npm-image]: https://img.shields.io/npm/v/aws-config.svg?style=flat
[npm-url]: https://npmjs.org/package/aws-config
[travis-image]: https://img.shields.io/travis/aerobatic/aws-config.svg?style=flat
[travis-url]: https://travis-ci.org/aerobatic/aws-config
[coveralls-image]: https://img.shields.io/coveralls/aerobatic/aws-config.svg?style=flat
[coveralls-url]: https://coveralls.io/r/aerobatic/aws-config?branch=master
[downloads-image]: https://img.shields.io/npm/dm/aws-config.svg?style=flat
[downloads-url]: https://npmjs.org/package/aws-config

---
_Source: https://npm.io/package/aws-config · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
