Skip to content

Instantly share code, notes, and snippets.

View guikaercher's full-sized avatar
🏠
Working from home

Guilherme Kaercher guikaercher

🏠
Working from home
View GitHub Profile
@guikaercher
guikaercher / upload file to S3 AWS.js
Last active December 4, 2018 15:35
upload file to S3 AWS
// 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,
});
@ServerlessBot
ServerlessBot / IAMCredentials.json
Last active December 20, 2023 16:50
Minimum credential set for Serverless Framework
{
"Statement": [
{
"Action": [
"apigateway:*",
"cloudformation:CancelUpdateStack",
"cloudformation:ContinueUpdateRollback",
"cloudformation:CreateChangeSet",
"cloudformation:CreateStack",
"cloudformation:CreateUploadBucket",
@guikaercher
guikaercher / customLogger.js
Last active August 9, 2020 13:36
Custom logger with winston snippet
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({