This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const winston = require('winston') | |
const { createLogger, format } = require('winston') | |
const { combine, timestamp, printf } = format | |
const moment = require('moment') | |
require('winston-daily-rotate-file') | |
// SEND LOGS TO A BUCKET | |
/* | |
const S3StreamLogger = require('s3-streamlogger').S3StreamLogger | |
const s3Stream = new S3StreamLogger({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Statement": [ | |
{ | |
"Action": [ | |
"apigateway:*", | |
"cloudformation:CancelUpdateStack", | |
"cloudformation:ContinueUpdateRollback", | |
"cloudformation:CreateChangeSet", | |
"cloudformation:CreateStack", | |
"cloudformation:CreateUploadBucket", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Please remember there are constants that are not defined in this scripts | |
// You have to set logs dir, bucket credentials and so forth | |
const uploadToS3 = (fileName) => { | |
let s3bucket = new AWS.S3({ | |
accessKeyId: IAM_USER_KEY, | |
secretAccessKey: IAM_USER_SECRET, | |
Bucket: BUCKET_NAME, | |
}); |