skip to Main Content

I am trying to create a layer based on the ready-made zip file here: https://github.com/diegoparrilla/headless-chrome-aws-lambda-layer

The zip file is 80mb, which is larger than the maximum allowable console direct upload size of 50mb, but I verified the unzipped size is 211mb, which is smaller than the maximum allowable total unzipped size of 250mb.

I have verified I am able to access my AWS account using keys stored in the configurations, and I am using us-east-1 location.

I run the following: aws lambda publish-layer-version --layer-name layer-headless_chrome-v0.2-beta.0 --zip-file fileb://layer-headless_chrome-v0.2-beta.0.zip --compatible-runtimes "python3.8"

And it produces the following error: botocore.exceptions.SSLError: SSL validation failed for https://lambda.us-east-1.amazonaws.com/2018-10-31/layers/layer-headless_chrome-v0.2-beta.0/versions EOF occurred in violation of protocol (_ssl.c:2423)

2

Answers


  1. You will need to separate the S3 upload task from publish-layer-version task, the CLI is still subject to the 50 MB size limit for a packaged upload of a zipped lambda layer. Uploading to S3 first as a discrete step and then invoking publish-layer-version with the –content parameter should allow your subsequent task to succeed.

    aws s3 cp layer-headless_chrome-v0.2-beta.0.zip s3://<YOUR_BUCKET_NAME>/layer-headless_chrome.zip
    aws lambda publish-layer-version 
        --layer-name HeadlessChromium 
        --region <YOUR_AWS_REGION> 
        --content S3Bucket=<YOUR_BUCKET_NAME>,S3Key=layer-headless_chrome.zip 
        --compatible-runtimes python3.8
    
    Login or Signup to reply.
  2. Try adding this in your ~/.aws/config file

    [profile whatever]
    s3 =
      max_concurrent_requests = 20
      max_queue_size = 10000
      multipart_threshold = 64MB
      multipart_chunksize = 16MB
      max_bandwidth = 50MB/s
      addressing_style = path
    
    

    Worked like charm after trying to fix it for hours!!

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search