AWS Certified Developer – Associate (DVA-C02) — Question 496
A company is developing a set of AWS Lambda functions to process data. The Lambda functions need to use a common third-party library as a dependency. The library is frequently updated with new features and bug fixes. The company wants to ensure that the Lambda functions always use the latest version of the library.
Which solution will meet these requirements in the MOST operationally efficient way?
Answer options
- A. Store the dependency and the function code in an Amazon S3 bucket.
- B. Create a Lambda layer that includes the library. Attach the layer to each Lambda function.
- C. Install the dependency in an Amazon Elastic File System (Amazon EFS) file system. Attach the file system to each Lambda function.
- D. Create a new Lambda function to load the library. Configure the existing Lambda functions to invoke the new Lambda function when the existing functions need to use the library.
Correct answer: C
Explanation
Mounting an Amazon EFS file system to the Lambda functions allows the shared library to be updated in a single centralized location, ensuring that all functions immediately access the newest version without needing redeployment. In contrast, updating a Lambda layer (Option B) requires manually updating the configuration of every individual Lambda function to reference the new layer version. Options A and D introduce significant operational complexity, latency, and deployment overhead compared to the shared EFS solution.