Skip to content

Latest commit

 

History

History
41 lines (25 loc) · 1.58 KB

README.md

File metadata and controls

41 lines (25 loc) · 1.58 KB

License: MIT

Generate PDF document via Puppeteer running on AWS Lambda

This repo contains a serverless application that takes a HTML template and return a PDF in form of a binary

Diagram

Diagram

Requirements

How to Run

  1. Clone this repo git clone https://github.com/zahaar/generate-pdf-lambda

  2. Import cUrl to Insomnia ( Postman is not recommended, as it can't visualize Pdf ).

  3. Run make api-local to have local API GW running.

  4. Send cUrl request via Insomnia.

You can also invoke Lambda bypassing API GW, by supplying an example event in file, and running make invokation-local. The response would be a base64 encoded PDF binary.

How to Deploy

A configured AWS CLI V2 is a must -> AWS Console Account && API Keys

  1. make deploy

  2. Fetch AWS SAM deploy output URL Value, and change the Url in Insomnia from localhost to that value. execution result in Insomnia End-Result

Improvements

  • Add Authorization Layer to API GW.
  • Configure API GW rate limits and throttling.
  • Enable API GW cache.