-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
40 lines (36 loc) · 975 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
'use strict';
const AWS = require('aws-sdk');
const _ = require('lodash');
const { ProxyAgent } = require('proxy-agent');
const clientConfig = require('./lib/client-config');
module.exports = {
initialize: (conf) => {
const awsConf = {};
const configurationKeys = [
'accessKeyId',
'secretAccessKey',
'region',
'proxy',
'maxRetries',
'retryDelayOptions',
'apiVersion'
];
configurationKeys.forEach((key) => {
if (key === 'proxy' && conf.proxy) {
clientConfig.httpOptions = {
agent: new ProxyAgent({ getProxyForUrl: _.constant(conf.proxy) })
};
} else if (key in conf) {
awsConf[key] = conf[key];
}
});
AWS.config.update(awsConf);
},
Athena: require('./lib/athena'),
DynamoDB: require('./lib/dynamo'),
CloudSearch: require('./lib/cloudsearch'),
SDK: AWS,
SNS: require('./lib/sns'),
SQS: require('./lib/sqs'),
SSM: require('./lib/ssm')
};