I'm trying to use wkhtmltopdf in my Python 3.13 lambda function. But I'm receiving the error
Failed to update the function ___: AWS Lambda could not unzip the deployment package.
Steps:
I downloaded this repository wkhtmltopdf and ran ./build.sh
, this command generated a zip folder with "bin" and "lib" folder
AWS just accepts 10MB zip folder and I needed upload in S3 and paste the folder URL https://bucketname.s3.region.amazonaws.com/wkhtmltopdf.zip
What am I forgetting to do?
I checked wkhtmltopdf, it is used as a lambda layer.
If you just want to use it without modification. You don't need to download it, just add the layer in your lambda.
- Open the Functions page of the Lambda console.
- Choose the function.
- Scroll down to the Layers section, and then choose Add a layer.
- Input Specify an ARN
- Choose Add.
https://docs.aws.amazon.com/lambda/latest/dg/adding-layers.html