• Stars
    star
    269
  • Rank 152,307 (Top 4 %)
  • Language
    JavaScript
  • Created almost 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Serverless Framework + AWS Lambda Layers + Puppeteer = ❤️

Serverless Puppeteer using AWS Lambda Layers

Twitter: rafalwilinski

Recently AWS introduced Layers which enables sharing common code between functions and working with large dependencies (such as headless chrome) much easier.

This project example returns a screenshot of page requested via ?address= query parameter.

Demo

Usage

It is very important to tell NPM to skip installing chromium from puppeteer package. To do so, installing dependencies should be done using this command:

PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1 npm install

or

PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1 yarn

Without this, your function size would be more than 200MB which is way too much.

After that, you can simply deploy your funciton.

sls deploy

curl <DEPLOYED_ENDPOINT>?address=https://google.com

or apply this ARN to your function directly: arn:aws:lambda:us-east-1:085108115628:layer:chrome:6

Bundling latest Chromium on your own

Prerequisites:

  • brotli
./download-latest.sh

Credits for this solution go to San Kumar

Author

👤 Rafal Wilinski

Show your support

Give a ⭐️ if this project helped you!

More Repositories

1

express-status-monitor

🚀 Realtime Monitoring solution for Node.js/Express.js apps, inspired by status.github.com, sponsored by https://dynobase.dev
JavaScript
3,586
star
2

telegram-chatgpt-concierge-bot

Interact with OpenAI's ChatGPT via Telegram and Voice.
TypeScript
1,059
star
3

s3-uploader

🍎 macOS Electron+React App for uploading files to S3 directly from Status Bar
JavaScript
138
star
4

serverless-medium-text-to-speech

🔊 Serverless-based, text-to-speech service for Medium articles
JavaScript
91
star
5

elastic-beanstalk-terraform-setup

🎬 Playbook for setting up & deploying AWS Beanstalk Applications on Docker with 1 command
HCL
82
star
6

Particle-Sea

🎉 Particle Sea made in Unity3D
GLSL
57
star
7

fargate-calc

AWS Fargate Pricing Calculator in Vue.js
JavaScript
39
star
8

deploy-with-serverless

Deploy Serverless Framework architectures with a single click, no terminal required
JavaScript
39
star
9

edge-graphql-dynamodb-api

Serverless GraphQL API on Edge with Global DynamoDB Tables
TypeScript
30
star
10

cloudtempo

CloudTempo
TypeScript
29
star
11

serverless-go-graphql

Serverless Framework template with Golang, GraphQL and DynamoDB
Go
28
star
12

cloudwatch-public-metrics

Expose AWS Cloudwatch Metrics as a public HTML page using AWS Lambda and server-side rendering
JavaScript
27
star
13

serverless-pagespeed-monitoring

🏎 Measure your webpage real speed from multiple regions in a serverless way
JavaScript
25
star
14

aws-lambda-golang-cdk

Higher level CDK construct for Golang Lambda functions
TypeScript
24
star
15

dynamodb-migrations

Functionless-based mini-framework for DynamoDB migrations in AWS CDK.
TypeScript
23
star
16

github-to-s3-lambda-deployer

⚓️ GitHub webhook extension for uploading static pages to AWS S3 directly after commiting to master via Lambda written in Node.js
JavaScript
23
star
17

aws-xray-ts-decorator

Instrument your Typescript code with AWS X-Ray using elegant decorators
TypeScript
20
star
18

serverless-iot-metrics-dashboard

Serverless & code-less (as possible) solution for gathering data from IoT sensors to the cloud without Lambda functions.
JavaScript
19
star
19

serverless-websockets-chat

Realtime chat app based on AWS Lambda, API Gateway, DynamoDB, Websockets, React in TS
TypeScript
19
star
20

terraform-vs-cdk

Terraform vs AWS CDK comparison
HCL
17
star
21

serverless-vscode-snippets

Serverless Framework snippets for VS Code
14
star
22

serverless-component-ts

Boilerplate for your own Serverless Component in Typescript
TypeScript
10
star
23

lobby

Next.js & Koa based system for matching students with theses'
JavaScript
8
star
24

serverless-web-performance-monitor

AWS / Serverless powered SaaS to track performance of your web apps from all around the world
TypeScript
8
star
25

serverless-develop

Deploy your functions to AWS Lambda as you code, in realtime
JavaScript
7
star
26

hybrid-load-balancing

Hybrid Load Balancing between EC2 and Lambda example with Serverless Framework
JavaScript
6
star
27

amplify-typescript-demo

Project example showing how to use Typescript in AWS Amplify functions
JavaScript
5
star
28

marching-cubes-webgl

🌋 Marching Cubes algorithm implementation in WebGL
JavaScript
5
star
29

servicefull

Serverless focused blog by Rafal Wilinski
JavaScript
4
star
30

instats-backend

📸 Instats backend service written in Node.js
JavaScript
4
star
31

prompt-testing-framework

Test how good your prompts are against the expected results.
TypeScript
4
star
32

wildspot

🏕 React & Firebase based app for finding best wild spots for setting up a tent
JavaScript
3
star
33

cloud-observer

AWS-CDK based solution for passing various AWS CloudWatch Events to your email or Slack channel
TypeScript
3
star
34

TurnBasedGame_Unity3D

♛ Simple turn based game made for recruitment process
C#
2
star
35

annual

Annual goals-oriented extension for Google Chrome
JavaScript
1
star
36

rpi-security-stream

🎥 Python + Flask video streaming service
Python
1
star
37

jamstack-job-board

JAMStack and AWS AppSync + Amplify powered job board
TypeScript
1
star
38

paddle-contracted-mrr

Small program written in Rust to calculate contracted MRR from Paddle.com subscriptions
Rust
1
star
39

ProceduralRacerProject

C#
1
star
40

cachr

📟 Simple HTTP Caching proxy in Clang
C
1
star