![lambda pdfkit lambda pdfkit](https://pspdfkit.com/assets/images/blog/2019/generate-invoices-pdfkit-node/screenshot-ce88f8b7.png)
![lambda pdfkit lambda pdfkit](https://i.ytimg.com/vi/_Yk7coHRmZg/maxresdefault.jpg)
Create a nat gateway with a public subnet.Create a vpc with at least two private subnets and one public subnet.You can pass several configuration options like header, footer, margin …etc Python wrapper package pdfkit is an excellent package.It will generate cloud formation template at the end to deploy all the resources. AWS SAM is an extended template for cloud formation to deploy lambda and api gateway.Cloudwatch and SNS can be configured for logging and error alert.Use AWS Sam template and SAM(serverless application model) cli to package and deploy lambda with API gateway.Configure a lambda function to deploy the container and API gateway to publish it.Use Docker file to package it as a container.
Lambda pdfkit pdf#
wkhtmltopdf library with python wrapper pdfkit can be used to generate HTML to pdf.Include chart.js library to handle several charts To generate a pdf report with dynamic data binding, a python template engine like Jinja2 can be used.Container image with all the dependencies will be deployed in Aws lambda.As a programming language, python3.9 can be used.To implement an event-driven and cost-effective solution I choose AWS lambda and API gateway to publish the service.The solution should be cost-effective and event-driven. Problem statements: want to implement a microservice to generate a pdf report which will communicate with the RDS database and other third-party APIs to get the data and generate a complex pdf report which will have some charts, javascript logic, and dynamic data. Build API with AWS Lambda, container, and API gateway