Q6Data Operations and Support
A data engineer maintains custom Python scripts that perform a data formatting process that many AWS Lambda functions use. When the data engineer needs to modify the Python scripts, the data engineer must manually update all the Lambda functions. The data engineer requires a less manual way to update the Lambda functions. Which solution will meet this requirement?
← → navigate · a answer
Community votes
Discussion · 10
24
B. Package the custom Python scripts into Lambda layers. Apply the Lambda layers to the Lambda functions.
Explanation:
Lambda layers let you centrally manage shared code and dependencies across multiple Lambda functions. By packaging the custom Python scripts into a Lambda layer, you can just update the layer whenever the scripts change, and all the Lambda functions that use the layer will automatically pick up the updates. This approach reduces manual effort and keeps consistency across the functions.
B 4
Selected Answer: B
Centralized Code Management: Lambda layers let you store and manage the custom Python scripts in a central place outside the individual Lambda function code. This removes the need to update the script in each Lambda function manually.
Reusable Code: Layers provide a way to share code across multiple Lambda functions. Any changes made to the layer code are automatically reflected in all the functions using that layer, making updates easier.
Reduced Deployment Size: By separating core functionality into layers, you can keep the individual Lambda function code focused and smaller. This reduces deployment package size and can potentially improve Lambda execution times.
2
Typical use case for Lambda Layers.
Option B.
2
Option B
2
B is correct
B 2
Selected Answer: B
Lambda Layers is a feature made with this exact objective in mind.
B 1
Selected Answer: B
Lamba layers
B 1
Selected Answer: B
B is right
B 1
Selected Answer: B
B is right
B 1
Selected Answer: B
Lambda layers are built exactly for this use-case — sharing common libraries or custom code across multiple Lambda functions.
When you update the layer version, all Lambda functions using that layer can begin using the new version with minimal changes, avoiding manual updates to each function's code base.
Why the others are incorrect
A & C:
Storing pointers in S3 (either in context or environment variables) does not solve the problem. Lambda cannot “pull” Python scripts from S3 at runtime and treat them as importable modules without custom logic.
D:
Aliases are for versioning and traffic shifting. They do not distribute or update shared code across multiple Lambda functions.