A Lambda function that converts large image files has grown after adding a new module. The larger bundle has made deployments slower. How can a developer decrease the deployment time for the Lambda function?
Choose an answer
Tap an option to check your answer.
Correct answer: Place dependencies in Lambda layers and have the function load them from layers..
Why this is the answer
Using Lambda layers is the most effective way to decrease deployment time for a large Lambda function with many dependencies. Layers allow you to separate your function code from its dependencies. When you update your function code, only the smaller function package needs to be deployed, as the larger dependency layer remains unchanged. This significantly reduces the size of the deployment package and, consequently, the deployment time. AWS CodeDeploy is a deployment service, but it doesn't inherently reduce the size of the Lambda deployment package itself. Increasing memory allocation affects runtime performance, not deployment time. While dependencies can be stored in S3, Lambda functions cannot directly load dependencies from S3 during deployment in a way that reduces the deployment package size; they still need to be packaged with the function or accessed via a layer.
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