A Lambda function requires a third-party library composed of many files totaling 100 MB. The library must be available in the Lambda execution environment, and the developer wants to minimize the deployment package size and operational overhead. Which approach meets these requirements with the least operational work?
Choose an answer
Tap an option to check your answer.
Correct answer: Create a Lambda layer that contains the third-party library and configure the function to use that layer..
Why this is the answer
Creating a Lambda layer for the third-party library is the most efficient solution. Lambda layers are designed to manage common dependencies, reducing the size of the deployment package and allowing multiple functions to share the same library. This minimizes operational overhead as the library only needs to be updated in one place. Uploading to S3 and mounting is not a native Lambda feature for libraries and would require complex custom solutions. Placing the library in /tmp during deployment would still increase the deployment package size and is not a persistent or shared solution. Using Amazon EFS is an option for larger, persistent file systems but introduces more operational overhead and cost than a Lambda layer for shared libraries.
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