File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 1
1
const AWS = require ( 'aws-sdk' ) ;
2
+
3
+ const {
4
+ S3
5
+ } = require ( "@aws-sdk/client-s3" ) ;
6
+
2
7
const git = require ( './util/git' ) ;
3
8
const { createRegisterAsyncTaskFn } = require ( './util/async-grunt-task' ) ;
4
9
const semver = require ( 'semver' ) ;
@@ -44,6 +49,9 @@ module.exports = function (grunt) {
44
49
throw new Error ( 'Missing S3 config values' ) ;
45
50
}
46
51
52
+ // JS SDK v3 does not support global configuration.
53
+ // Codemod has attempted to pass values to each service client in this file.
54
+ // You may need to update clients outside of this file, if they use global config.
47
55
AWS . config . update ( { accessKeyId : key , secretAccessKey : secret } ) ;
48
56
}
49
57
@@ -82,7 +90,12 @@ module.exports = function (grunt) {
82
90
} ;
83
91
84
92
function s3PutObject ( uploadParams ) {
85
- const s3 = new AWS . S3 ( ) ;
93
+ const s3 = new S3 ( {
94
+ credentials : {
95
+ accessKeyId : key ,
96
+ secretAccessKey : secret
97
+ }
98
+ } ) ;
86
99
return new Promise ( ( resolve , reject ) => {
87
100
s3 . putObject ( uploadParams , ( err ) => {
88
101
if ( err != null ) {
You can’t perform that action at this time.
0 commit comments