
AWS Certified Developer - Associate
Get started today
Ultimate access to all questions.
In a serverless application, two AWS Lambda functions process photos: one for storing objects in S3 and metadata in DynamoDB, and another for fetching objects using metadata. Both use a shared Python library, nearing the deployment package size limit. How can the developer minimize package size with minimal operational impact?
In a serverless application, two AWS Lambda functions process photos: one for storing objects in S3 and metadata in DynamoDB, and another for fetching objects using metadata. Both use a shared Python library, nearing the deployment package size limit. How can the developer minimize package size with minimal operational impact?
Explanation:
The correct answer is B. Creating a Lambda layer with the required Python library and using it in both Lambda functions is the best approach to reduce the size of the deployment packages with the least operational overhead. A Lambda layer allows you to maintain a single copy of the library that can be shared across multiple functions, thus optimizing resource usage and simplifying updates. This is recommended by AWS best practices for handling common dependencies among multiple Lambda functions.