
Answer-first summary for fast verification
Answer: Utilize a Lambda layer containing the Python library for both functions.
The correct answer is B. Creating a Lambda layer with the required Python library and using it in both Lambda functions is the best approach to reduce the size of the deployment packages with the least operational overhead. A Lambda layer allows you to maintain a single copy of the library that can be shared across multiple functions, thus optimizing resource usage and simplifying updates. This is recommended by AWS best practices for handling common dependencies among multiple Lambda functions.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
In a serverless application, two AWS Lambda functions process photos: one for storing objects in S3 and metadata in DynamoDB, and another for fetching objects using metadata. Both use a shared Python library, nearing the deployment package size limit. How can the developer minimize package size with minimal operational impact?
A
Distribute the Python library across separate .zip archives for each Lambda function.
B
Utilize a Lambda layer containing the Python library for both functions.
C
Merge the functions into one, deploying a unified .zip archive.
D
Store the Python library in an S3 bucket and have Lambda functions reference it.
No comments yet.