AWS Certified Developer – Associate (DVA-C02) — Question 83
A developer is updating several AWS Lambda functions and notices that all the Lambda functions share the same custom libraries. The developer wants to centralize all the libraries, update the libraries in a convenient way, and keep the libraries versioned.
Which solution will meet these requirements with the LEAST development effort?
Answer options
- A. Create an AWS CodeArtifact repository that contains all the custom libraries.
- B. Create a custom container image for the Lambda functions to save all the custom libraries.
- C. Create a Lambda layer that contains all the custom libraries.
- D. Create an Amazon Elastic File System (Amazon EFS) file system to store all the custom libraries.
Correct answer: C
Explanation
Creating a Lambda layer is the most efficient solution for sharing libraries across multiple Lambda functions, as it allows for versioning and easy updates without modifying each function. The other options, while viable, involve more overhead: AWS CodeArtifact and EFS require additional management, and a custom container image adds complexity to the deployment process.