Multiple Lambda functions all rely on shared custom Python formatting scripts. Currently, the engineer updates each Lambda individually when the scripts change. Which approach will allow updating the scripts without manually changing every function?
Choose an answer
Tap an option to check your answer.
Correct answer: Package the custom Python scripts into Lambda layers. Apply the Lambda layers to the Lambda functions..
Why this is the answer
Packaging custom Python scripts into Lambda layers is the most efficient solution for sharing code among multiple Lambda functions. Lambda layers allow you to centralize common code and dependencies, making updates much simpler. When the scripts change, you only need to update the layer, and all associated Lambda functions will automatically use the new version. Storing pointers in S3 (either in the execution context or environment variables) would require the Lambda functions to download and load the scripts at runtime, adding latency and complexity. Assigning the same alias to each Lambda function doesn't address the underlying issue of shared code updates; aliases are for versioning and routing traffic, not for code sharing.
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