nerdexam
Amazon

DVA-C02 · Question #186

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…

The correct answer is C. Define a Lambda layer that contains all of the shared dependencies. Lambda Layers (C) solve the problem directly by letting you package shared dependencies once and attach that layer to multiple functions - updating the layer propagates to all attached functions instantly, eliminating duplicated effort with minimal added complexity. Why the…

Submitted by lukas.cz· Mar 5, 2026Development with AWS Services

Question

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?

Options

  • ADefine a maintenance window for the Lambda functions to ensure that the functions get updated
  • BUpgrade the Lambda functions to the most recent runtime version.
  • CDefine a Lambda layer that contains all of the shared dependencies.
  • DUse an AWS CodeCommit repository to host the dependencies in a centralized location.

How the community answered

(28 responses)
  • A
    4% (1)
  • B
    11% (3)
  • C
    71% (20)
  • D
    14% (4)

Explanation

Lambda Layers (C) solve the problem directly by letting you package shared dependencies once and attach that layer to multiple functions - updating the layer propagates to all attached functions instantly, eliminating duplicated effort with minimal added complexity.

Why the distractors are wrong:

  • A (Maintenance window): Maintenance windows schedule updates but don't reduce the duplication - you'd still need to update each function individually.
  • B (Upgrade runtime version): Updating the Lambda runtime version affects the execution environment (e.g., Node.js 18 → 20), not your custom application dependencies.
  • D (CodeCommit repository): Centralizing source code in a repo doesn't automatically deploy updated dependencies to running Lambda functions; it adds a pipeline step without solving the deployment duplication.

Memory tip: Think of a Lambda Layer as a shared node_modules or site-packages folder mounted into every function that needs it - one update, many consumers. If the question involves shared code or dependencies across multiple Lambdas, Lambda Layers is almost always the answer.

Topics

#AWS Lambda#Lambda Layers#Dependency Management#Code Reusability

Community Discussion

No community discussion yet for this question.

Full DVA-C02 Practice