|
1 | | -'use strict' |
2 | | - |
3 | | -const aws = require('aws-sdk') |
4 | | -const proxy = require('proxy-agent') |
5 | | - |
6 | | -module.exports = { |
7 | | - sdk: aws, |
8 | | - updateConfig (config, region) { |
9 | | - const awsSecurity = { region } |
10 | | - |
11 | | - if (config.profile) { |
12 | | - aws.config.credentials = new aws.SharedIniFileCredentials({ |
13 | | - profile: config.profile |
14 | | - }) |
15 | | - } else { |
16 | | - awsSecurity.accessKeyId = config.accessKey |
17 | | - awsSecurity.secretAccessKey = config.secretKey |
18 | | - } |
19 | | - |
20 | | - if (config.sessionToken) { |
21 | | - awsSecurity.sessionToken = config.sessionToken |
22 | | - } |
23 | | - |
24 | | - if (config.deployTimeout) { |
25 | | - aws.config.httpOptions.timeout = parseInt(config.deployTimeout) |
26 | | - } |
27 | | - |
28 | | - if (config.proxy) { |
29 | | - aws.config.httpOptions.agent = proxy(config.proxy) |
30 | | - } |
31 | | - |
32 | | - if (config.endpoint) { |
33 | | - aws.config.endpoint = config.endpoint |
34 | | - } |
35 | | - |
36 | | - aws.config.update(awsSecurity) |
37 | | - } |
38 | | -} |
| 1 | +// TODO: |
| 2 | +// Support these option settings in SDK v3 |
| 3 | +// |
| 4 | +// 'use strict' |
| 5 | +// |
| 6 | +// const aws = require('aws-sdk') |
| 7 | +// const proxy = require('proxy-agent') |
| 8 | +// |
| 9 | +// module.exports = { |
| 10 | +// sdk: aws, |
| 11 | +// updateConfig (config, region) { |
| 12 | +// const awsSecurity = { region } |
| 13 | +// |
| 14 | +// if (config.profile) { |
| 15 | +// aws.config.credentials = new aws.SharedIniFileCredentials({ |
| 16 | +// profile: config.profile |
| 17 | +// }) |
| 18 | +// } else { |
| 19 | +// awsSecurity.accessKeyId = config.accessKey |
| 20 | +// awsSecurity.secretAccessKey = config.secretKey |
| 21 | +// } |
| 22 | +// |
| 23 | +// if (config.sessionToken) { |
| 24 | +// awsSecurity.sessionToken = config.sessionToken |
| 25 | +// } |
| 26 | +// |
| 27 | +// if (config.deployTimeout) { |
| 28 | +// aws.config.httpOptions.timeout = parseInt(config.deployTimeout) |
| 29 | +// } |
| 30 | +// |
| 31 | +// if (config.proxy) { |
| 32 | +// aws.config.httpOptions.agent = proxy(config.proxy) |
| 33 | +// } |
| 34 | +// |
| 35 | +// if (config.endpoint) { |
| 36 | +// aws.config.endpoint = config.endpoint |
| 37 | +// } |
| 38 | +// |
| 39 | +// aws.config.update(awsSecurity) |
| 40 | +// } |
| 41 | +// } |
0 commit comments