Question 1 · choose 1
A Python AWS Lambda function needs machine learning libraries that take about 1.2 GB once unpacked. Deploying it as a .zip archive fails because of the package size. The team wants to keep running the code on Lambda. How should the developer package the function?
- AAs a container image in Amazon ECR, built from an AWS base image for Lambda
- BAs a smaller .zip with the libraries split across five Lambda layers
- CAs the same .zip archive, uploaded through Amazon S3 instead of directly
- DAs the same .zip archive, with the function's memory raised to 10,240 MB
Show the answer and why
AAs a container image in Amazon ECR, built from an AWS base image for Lambda
Correct
A container image can be up to 10 GB uncompressed, including all of its layers, which fits the libraries.
BAs a smaller .zip with the libraries split across five Lambda layers
Incorrect
The 250 MB unzipped limit covers the deployment package together with its layers, so splitting the libraries into layers does not help.
CAs the same .zip archive, uploaded through Amazon S3 instead of directly
Incorrect
Uploading through S3 avoids the 50 MB limit for direct uploads, but the 250 MB limit on the unzipped contents still applies.
DAs the same .zip archive, with the function's memory raised to 10,240 MB
Incorrect
Memory sets the function's runtime memory and CPU. It does not change the size limits of the deployment package.
.zip packages, layers included, are limited to 250 MB unzipped; container images allow up to 10 GB.
AWS documentation