s3 node
-
How to upload file to s3 bucket using aws-sdk on node.jsInfra/AWS 2019. 12. 23. 18:11
버킷 생성 IAM 생성 소스코드 // example.js const fs = require("fs"); const AWS = require("aws-sdk"); const s3 = new AWS.S3({ accessKeyId: process.env.ACCESS_KEY_ID, secretAccessKey: process.env.SECRET_ACCESS_KEY }); export const uploadLogFiles = () => { return new Promise((resolve: any, reject: any) => { fs.readdir("./log", function (err: any, filenames: any) { if (err) { console.log("ERROR IN READING LOG ..