You created reusable code packaged as a zip that multiple Lambda functions need to use. You must deploy this shared code and update the Lambda functions to use it with the highest operational efficiency. Which solution is best?
Choose an answer
Tap an option to check your answer.
Correct answer: Package the code as a Lambda layer and attach that layer to the Lambda functions that require it..
Why this is the answer
Packaging the shared code as a Lambda layer is the most operationally efficient solution. Lambda layers allow you to centralize common code and dependencies, reducing the deployment package size for individual functions and simplifying updates. When the shared code needs to be updated, you only need to update the layer, and all associated functions will automatically use the new version. Uploading to S3 and configuring an import path is less efficient because each function would still need to download and unpack the zip at runtime, increasing cold start times and complexity. Creating a new Lambda function to invoke synchronously adds unnecessary latency and operational overhead. Building a container image is a valid approach for larger, more complex dependencies or custom runtimes, but for reusable code packaged as a zip, Lambda layers offer a simpler and more efficient solution for this specific use case.
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