How to use ImageMagick in an AWS Lambda function

Viewed 5270

I am trying to create a lambda that utilizes ImageMagick to convert PDF to images.

For this to work I can upload a binary of ImageMagick.

This approach fails as it seems there are some shared libraries IM depends on.

Is there a way to install ImageMagick either as a layer or get it all packaged up with its dependencies?
Or maybe a different solution all together is the right one.

Right now, I have verified I can upload binaries as part of a Lambda package and call them.

3 Answers

There is already a AWS lambda layer build available. Make sure you have docker first, then:

git clone https://github.com/serverlesspub/imagemagick-aws-lambda-2.git
cd imagemagick-aws-lambda-2
make all
Related