Serverless PDF rendering on AWS Lambda
Built and shipped a containerized AWS Lambda (.NET 8) that renders HTML to PDF on demand, with a headless Chromium and a CloudFormation plus CodePipeline CI/CD.
AWS Lambda
.NET 8
Serverless
CI/CD

Context. Capcod's DocGen microservice turns HTML templates into PDFs. The rendering step is bursty and CPU-heavy, so I moved it out of the always-on service and onto a dedicated AWS Lambda.

#What I built

  • A container-image Lambda on .NET 8 (custom runtime via LambdaBootstrapBuilder), bundling a Lambda-optimized headless Chromium that does the HTML-to-PDF rendering.
  • The CI/CD as code: a CloudFormation template that defines a CodePipeline and CodeBuild to build the Docker image, push it to ECR, pull private dependencies from CodeArtifact, and update the function.
  • The client side: the main .NET service invokes the Lambda through the AWS SDK (IAmazonLambda). I handled Lambda's 6 MB synchronous payload limit by base64-encoding the PDF in the response.

#Why it's here

This is real production AWS work I owned end to end: Lambda, ECR, CodePipeline, CodeBuild and CodeArtifact, all in eu-central-1. It's the piece I point to first for serverless on AWS.

#Stack

AWS Lambda (container image) · .NET 8 / C# · headless Chromium · Docker / ECR · CodePipeline / CodeBuild · CloudFormation · CodeArtifact.