Skip to content

A simple AWS service to generate pdf and host it in s3 bucket

Notifications You must be signed in to change notification settings

SomiDivian/puppeteer-aws-pulumi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What's in here

  • AWS: Amazon cloud provider

  • Pulumi: Infrastructure as Code for Engineers

Notes

  • This is a simple service: simple authentication were used, no queue, no streaming

Setup Pulumi

  • To create a new project
mkdir my-project && cd my-project && pulumi new

then Pulumi will walk you through the setup of your project

  • Install pdf generation dependencies
npm install @sparticuz/chromium-min puppeteer-core generic-pool

we used @frimuchkov/hpdf source code in combination with @sparticuz/chromium

you need to host chromium-v110.0.1-pack.tar in a separate bucket in your s3 account, then add the public url to the s3FilePath variable in lambda/generate-pdf.ts

also don't forget to set ALLOWED_SECRET in lambda/index.ts to a random string

you may need to add this to your tsconfig.ts

...
+    "esModuleInterop": true,
...

Deployment

pulumi up

the deployment will take a while, then return a url to your service

About

A simple AWS service to generate pdf and host it in s3 bucket

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published