NOTE: This repo is no longer needed: qpdf/qpdf#352 (comment)
QPDF is a command-line program that does structural, content-preserving transformations on PDF files.
This project shows how to deploy the qpdf
binary as an AWS Lambda Layer.
Currently the Makefile will download QPDF 10.0.1. You can change the version by altering the Makefile's MAJOR, MINOR, and PATCH numbers.
Lambda Layers is a new convenient way to manage common dependencies between different Lambda Functions.
The following command will create a well-structured layer of this package:
git clone https://github.com/Sparticuz/qpdf-aws-lambda.git
cd qpdf-aws-lambda
make
The resulting ZIP file qpdf-aws-lambda.zip
can be uploaded to the AWS Lambda Layers console.
According to AWS Documentation, there are two paths exported as environment variables directly related to AWS Lambda Layers (as they unzip under /opt
)
- LD_LIBRARY_PATH includes
/opt/lib
- PATH includes
/opt/bin
The ZIP file resulting from executing make
in this package will store both binary files under the corresponding directories, so it is ready to use system wide.
The Layer is independent from the Lambda Function Runtime, so it should be available for any of them.