Skip to content

Commit fb7016c

Browse files
authored
Merge pull request #186 from gorner/aws-v3
Update aws-sdk to v3
2 parents 3cd10c9 + cda50c9 commit fb7016c

File tree

3 files changed

+1196
-180
lines changed

3 files changed

+1196
-180
lines changed

lib/s3.js

+12-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,15 @@ var _ = require('lodash');
99
module.exports = CoreObject.extend({
1010
init: function(options) {
1111
this._super(options);
12-
var AWS = require('aws-sdk');
12+
13+
const {
14+
fromIni
15+
} = require('@aws-sdk/credential-providers');
16+
17+
const {
18+
S3
19+
} = require('@aws-sdk/client-s3');
20+
1321
var s3Options = {
1422
region: this.plugin.readConfig('region')
1523
};
@@ -54,15 +62,15 @@ module.exports = CoreObject.extend({
5462

5563
if (profile && !this.plugin.readConfig('s3Client')) {
5664
this.plugin.log('Using AWS profile from config', { verbose: true });
57-
AWS.config.credentials = new AWS.SharedIniFileCredentials({ profile: profile });
65+
s3Options.credentials = fromIni({ profile: profile });
5866
}
5967

6068
if (endpoint) {
6169
this.plugin.log('Using endpoint from config', { verbose: true });
62-
s3Options.endpoint = new AWS.Endpoint(endpoint);
70+
s3Options.endpoint = endpoint;
6371
}
6472

65-
this._client = this.plugin.readConfig('s3Client') || new AWS.S3(s3Options);
73+
this._client = this.plugin.readConfig('s3Client') || new S3(s3Options);
6674
},
6775

6876
upload: function(options) {

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
"test": "node tests/runner.js && ./node_modules/.bin/eslint index.js lib/* tests/**/*-test.js"
1919
},
2020
"dependencies": {
21-
"aws-sdk": "^2.1354.0",
21+
"@aws-sdk/client-s3": "^3.525.0",
22+
"@aws-sdk/credential-providers": "^3.525.0",
2223
"chalk": "^4.1.0",
2324
"core-object": "^3.1.5",
2425
"ember-cli-deploy-plugin": "^0.2.9",

0 commit comments

Comments
 (0)