AWS Certified Developer – Associate (DVA-C02) — Question 168
A developer has an application that is composed of many different AWS Lambda functions. The Lambda functions all use some of the same dependencies. To avoid security issues, the developer is constantly updating the dependencies of all of the Lambda functions. The result is duplicated effort for each function.
How can the developer keep the dependencies of the Lambda functions up to date with the LEAST additional complexity?
Answer options
- A. Define a maintenance window for the Lambda functions to ensure that the functions get updated copies of the dependencies.
- B. Upgrade the Lambda functions to the most recent runtime version.
- C. Define a Lambda layer that contains all of the shared dependencies.
- D. Use an AWS CodeCommit repository to host the dependencies in a centralized location.
Correct answer: C
Explanation
The correct answer is C, as defining a Lambda layer allows for shared dependencies to be managed in a single place, simplifying updates across multiple functions. Options A and B do not directly address the issue of managing shared dependencies, while D introduces unnecessary complexity by requiring a separate repository instead of leveraging Lambda layers.