amazon-web-servicesamazon-s3aws-lambda

Failed to update the function ___: AWS Lambda could not unzip the deployment package


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:

  1. I downloaded this repository wkhtmltopdf and ran ./build.sh, this command generated a zip folder with "bin" and "lib" folder

  2. 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?


Solution

  • 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.

    1. Open the Functions page of the Lambda console.
    2. Choose the function.
    3. Scroll down to the Layers section, and then choose Add a layer.
    4. Input Specify an ARN
    5. Choose Add.

    https://docs.aws.amazon.com/lambda/latest/dg/adding-layers.html