AWS Certified Developer – Associate (DVA-C02) — Question 52

A developer is designing a serverless application with two AWS Lambda functions to process photos. One Lambda function stores objects in an Amazon S3 bucket and stores the associated metadata in an Amazon DynamoDB table. The other Lambda function fetches the objects from the S3 bucket by using the metadata from the DynamoDB table. Both Lambda functions use the same Python library to perform complex computations and are approaching the quota for the maximum size of zipped deployment packages.
What should the developer do to reduce the size of the Lambda deployment packages with the LEAST operational overhead?

Answer options

Correct answer: B

Explanation

The correct answer is B because using a Lambda layer allows both functions to share the same library without duplicating it in each deployment package, thus reducing size with minimal overhead. Options A and C increase redundancy and overhead, while D complicates library management by requiring additional code to reference the library from S3.