Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# It is very common while debugging elixir projects, deployed using mix releases, to
# investigate code logic using "on the fly patches" by entering the running instance iex
# and pasting new code into it (obviously only in dev environment, not production).
# If you're using kubernetes with multiple deployments that must be updated with
# multiple modules definition (like if you're following a bug through multiple steps),
# this process will cost some time.
@duzzifelipe
duzzifelipe / aws-lambda-s3-puppeteer.js
Created October 3, 2019 14:55
Use puppeteer on aws lambda to render html content and upload a pdf from it to s3
// Setup:
// $ npm i --save aws-sdk@^2.541.0 chrome-aws-lambda@^1.20.0 puppeteer@^1.20.0
//
// Deploy Script:
// $ rm -Rf node_modules
// $ npm install
// $ rm -rf node_modules/puppeteer/.local-chromium/**
// $ rm pack.zip
// $ zip pack.zip index.js -r node_modules/*
// $ aws lambda --region $REGION update-function-code --function-name $LAMBDA_FN_NAME --zip-file fileb://pack.zip