DVA-C02 · Question #502
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 feature
The correct answer is B. Create a Lambda layer that includes the library. Attach the layer to each Lambda function.. This question tests knowledge of Lambda layers as a centralized, operationally efficient mechanism to share and manage common dependencies across multiple Lambda functions.
Question
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?
Options
- AStore the dependency and the function code in an Amazon S3 bucket.
- BCreate a Lambda layer that includes the library. Attach the layer to each Lambda function.
- CInstall the dependency in an Amazon Elastic File System (Amazon EFS) file system. Attach the
- DCreate a new Lambda function to load the library. Configure the existing Lambda functions to
How the community answered
(14 responses)- B79% (11)
- C14% (2)
- D7% (1)
Why each option
This question tests knowledge of Lambda layers as a centralized, operationally efficient mechanism to share and manage common dependencies across multiple Lambda functions.
Storing dependencies in S3 provides no native Lambda integration; each function deployment still requires manual packaging of the dependency, which is not operationally efficient.
Lambda layers allow you to package a shared library separately from function code and attach the layer to multiple functions. When the library is updated, you publish a new layer version and update the reference on each function, ensuring all functions immediately use the latest version without repackaging each deployment artifact individually.
Amazon EFS provides shared file storage but requires VPC configuration, introduces network latency on access, and is operationally more complex than Lambda layers for dependency management.
Creating a separate Lambda function to load the library adds architectural complexity, inter-function invocation latency, and additional cost.
Concept tested: Lambda layers for shared dependency management
Source: https://docs.aws.amazon.com/lambda/latest/dg/chapter-layers.html
Community Discussion
No community discussion yet for this question.