A team develops multiple Lambda functions that all depend on the same third-party library, which is updated frequently. The team wants the Lambda functions to always use the latest library version with the least operational overhead. What is the best solution?
Choose an answer
Tap an option to check your answer.
Correct answer: Package the library as a Lambda layer and attach that layer to each Lambda function..
Why this is the answer
Packaging the library as a Lambda layer is the most efficient solution. Lambda layers allow you to centralize common dependencies, reducing deployment package size and enabling independent updates. When the library is updated, you only need to update the layer, and all associated Lambda functions automatically use the new version upon their next invocation, minimizing operational overhead. Storing dependencies in an S3 bucket would require each Lambda function to download the library at runtime, increasing cold start times and complexity. Using Amazon EFS for dependencies adds network latency and cost, and is generally overkill for common library dependencies. Creating a separate Lambda function to load the library introduces unnecessary inter-function calls, increasing latency and complexity, and doesn't solve the core problem of managing shared dependencies efficiently.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed