-
AWS: Amazon cloud provider
-
Pulumi: Infrastructure as Code for Engineers
- This is a simple service: simple authentication were used, no queue, no streaming
- 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,
...
pulumi up
the deployment will take a while, then return a url to your service