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
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.
Try adding this in your
~/.aws/config
fileWorked like charm after trying to fix it for hours!!