DVA-C02 · Question #433
A developer needs to deploy the code for a new application on an AWS Lambda function. The application needs a dependency file that is 500 MB to run the business logic. Which solution will meet these r
The correct answer is D. Package the application code and dependencies into a container image. Push the image to an. A 500 MB dependency exceeds Lambda's 250 MB unzipped deployment package limit, so the solution must use a container image pushed to Amazon ECR, which supports images up to 10 GB.
Question
A developer needs to deploy the code for a new application on an AWS Lambda function. The application needs a dependency file that is 500 MB to run the business logic. Which solution will meet these requirements?
Options
- ACompress the application code and dependencies into a .zip file. Directly upload the .zip file as a
- BCompress the application code and dependencies into a .zip file. Upload the .zip file to an
- CPackage the application code and dependencies into a container image. Upload the image to an
- DPackage the application code and dependencies into a container image. Push the image to an
How the community answered
(26 responses)- A4% (1)
- B8% (2)
- C12% (3)
- D77% (20)
Why each option
A 500 MB dependency exceeds Lambda's 250 MB unzipped deployment package limit, so the solution must use a container image pushed to Amazon ECR, which supports images up to 10 GB.
Directly uploading a .zip file as a Lambda deployment package is limited to 50 MB zipped and 250 MB unzipped; a 500 MB dependency would exceed the unzipped limit.
Uploading the .zip to S3 and referencing it from Lambda still enforces the 250 MB unzipped size limit, so a 500 MB dependency cannot be deployed this way.
Packaging into a container image is correct, but uploading to Amazon S3 is not the right destination; container images for Lambda must be pushed to Amazon ECR, not S3.
AWS Lambda supports container images up to 10 GB stored in Amazon ECR, which comfortably accommodates a 500 MB dependency. Packaging the application and its dependencies into a container image and pushing it to ECR allows Lambda to pull and run the image without hitting the 250 MB unzipped deployment package size limit that applies to zip-based deployments.
Concept tested: Lambda container image deployment for large dependencies via ECR
Source: https://docs.aws.amazon.com/lambda/latest/dg/images-create.html
Community Discussion
No community discussion yet for this question.