Skip to content

Commit 13dd522

Browse files
committed
chore: run codemod on tasks/publish-to-aws.js
1 parent 1fc4ef0 commit 13dd522

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

tasks/publish-to-aws.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
const AWS = require('aws-sdk');
2+
3+
const {
4+
S3
5+
} = require("@aws-sdk/client-s3");
6+
27
const git = require('./util/git');
38
const { createRegisterAsyncTaskFn } = require('./util/async-grunt-task');
49
const semver = require('semver');
@@ -44,6 +49,9 @@ module.exports = function (grunt) {
4449
throw new Error('Missing S3 config values');
4550
}
4651

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.
4755
AWS.config.update({ accessKeyId: key, secretAccessKey: secret });
4856
}
4957

@@ -82,7 +90,12 @@ module.exports = function (grunt) {
8290
};
8391

8492
function s3PutObject(uploadParams) {
85-
const s3 = new AWS.S3();
93+
const s3 = new S3({
94+
credentials: {
95+
accessKeyId: key,
96+
secretAccessKey: secret
97+
}
98+
});
8699
return new Promise((resolve, reject) => {
87100
s3.putObject(uploadParams, (err) => {
88101
if (err != null) {

0 commit comments

Comments
 (0)