Skip to content

Commit 31c87b0

Browse files
committed
sdk-v3: Drop SDK V2
motdotlaGH-641 Drop SDK V2 as it should work with V3 if you do not set any options.
1 parent a02adef commit 31c87b0

File tree

6 files changed

+100
-482
lines changed

6 files changed

+100
-482
lines changed

lib/aws.js

Lines changed: 41 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,41 @@
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+
// }

lib/main.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
const process = require('process')
44
const path = require('path')
55
const os = require('os')
6-
const aws = require(path.join(__dirname, 'aws'))
76
const { exec, execSync, execFile } = require('child_process')
87
const fs = require('fs-extra')
98
const klaw = require('klaw')
@@ -957,7 +956,7 @@ they may not work as expected in the Lambda environment.
957956

958957
async _deployToRegion (program, params, region, buffer) {
959958
// sdk v3 todo: Migration of aws.updateConfig.
960-
aws.updateConfig(program, region)
959+
// aws.updateConfig(program, region)
961960
const config = { region }
962961

963962
console.log('=> Reading event source file to memory')

0 commit comments

Comments
 (0)