Skip to content

Commit b1bf9b3

Browse files
committed
[CHORE] migrated aws sdk from v2 to v3
1 parent d888d4d commit b1bf9b3

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"@types/mocha": "^9.1.1",
2121
"@types/mongoose": "^5.11.97",
2222
"@types/multer": "^2.0.0",
23-
"@types/multer-s3": "^2.7.0",
23+
"@types/multer-s3": "^3.0.1",
2424
"@types/node": "^18.0.6",
2525
"@types/supertest": "^2.0.12",
2626
"@typescript-eslint/eslint-plugin": "^5.30.5",
@@ -40,14 +40,14 @@
4040
"typescript": "^4.7.4"
4141
},
4242
"dependencies": {
43+
"@aws-sdk/client-s3": "^3.896.0",
4344
"@sentry/node": "^7.57.0",
4445
"@slack/client": "^5.0.2",
4546
"@slack/webhook": "^7.0.2",
4647
"@types/bcrypt": "^5.0.0",
4748
"@types/bcryptjs": "^2.4.2",
4849
"@types/chai-things": "^0.0.35",
4950
"@types/express-session": "^1.17.7",
50-
"aws-sdk": "^2.1172.0",
5151
"axios": "^0.27.2",
5252
"bcrypt": "^5.0.1",
5353
"bcryptjs": "^2.4.3",
@@ -64,7 +64,7 @@
6464
"jsonwebtoken": "^8.5.1",
6565
"mongoose": "^6.3.1",
6666
"multer": "^1.4.4",
67-
"multer-s3": "2",
67+
"multer-s3": "^3.0.1",
6868
"prettier": "^2.7.1",
6969
"slack-node": "^0.1.8"
7070
},

src/config/s3Client.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
import AWS from 'aws-sdk';
1+
import { S3Client } from '@aws-sdk/client-s3';
22
import config from '.';
33

4-
const s3: AWS.S3 = new AWS.S3({
5-
accessKeyId: config.s3AccessKey,
6-
secretAccessKey: config.s3SecretKey,
4+
const s3: S3Client = new S3Client({
5+
credentials: {
6+
accessKeyId: config.s3AccessKey,
7+
secretAccessKey: config.s3SecretKey
8+
},
9+
710
region: 'ap-northeast-2'
811
});
912

0 commit comments

Comments
 (0)