How to provide Lambda access to shared data and libraries?

DVA-C02 By islever Editorial Last updated

Short answer

C Set up an Amazon Elastic File System (Amazon EFS) file system with mount targets in the central VPConfigure the Lambda functions to mount the EFS file system. Update the Lambda function execution roles to give the functions to access the EFS file system.

Question

A developer has AWS Lambda functions that need to access a company's internal data science libraries and reference data. Separate teams manage the libraries and the data. The teams must be able to update and upload new data independently. The Lambda functions are connected to the company's central VPC. Which solution will provide the Lambda functions with access to the libraries and data?
  1. Attach an Amazon Elastic Block Store (Amazon EBS) volume to the Lambda functions by using EBS Multi-Attach in the central VPC. Update the Lambda function execution roles to give the functions to access the EBS volume. Update the Lambda function code to reference the files in the EBS volume.
  2. Compress the libraries and reference data in a Lambda /tmp folder. Update the Lambda function code to reference the files in the /tmp folder.
  3. Set up an Amazon Elastic File System (Amazon EFS) file system with mount targets in the central VPConfigure the Lambda functions to mount the EFS file system. Update the Lambda function execution roles to give the functions to access the EFS file system. Correct Answer
  4. Set up an Amazon FSx for Windows File Server file system with mount targets in the central VPC. Configure the Lambda functions to mount the Amazon FSx file system. Update the Lambda function execution roles to give the functions to access the Amazon FSx file system.

Key Takeaways

This question tests the ability to integrate persistent shared storage with Lambda, specifically distinguishing between the compatible EFS service and the incompatible EBS service.

To provide AWS Lambda functions with access to shared libraries and reference data that require independent updates, Amazon Elastic File System (Amazon EFS) is the optimal solution. The community consensus confirms that mounting an EFS file system allows Lambda functions to persistently access shared data within a VPC.

Common mistake: Selecting Amazon EBS is a common error because EBS volumes are strictly for EC2 instances and cannot be attached to Lambda functions.

Expert Analysis

Why the Answer Is Correct

Amazon EFS provides a scalable, elastic file system that supports network file system (NFS) protocols, making it ideal for Lambda functions running in a VPC. It allows concurrent read/write access, enabling separate teams to update libraries and data independently without modifying the Lambda function code or deployment packages. This architecture satisfies the requirement for shared, persistent storage accessible by multiple compute resources.

Why the Other Options Are Wrong

Option A is incorrect because Lambda functions do not support attaching Amazon EBS volumes; EBS is block storage designed exclusively for EC2 instances. Option B is incorrect because the /tmp directory is ephemeral, local to the specific execution environment, and limited in size (up to 10 GB), making it unsuitable for sharing data across different functions or teams. Option D is incorrect because Amazon FSx for Windows File Server relies on SMB protocols, which are not natively compatible with the Linux-based environment where Lambda functions operate.

Community Comment Notes

Community members unanimously selected Option C, emphasizing that EBS cannot be used with Lambda. Several comments cited official AWS documentation regarding Lambda configuration for file systems, reinforcing that EFS is the standard best practice for providing shared file access to serverless functions in a VPC.

Official Reference

Exam Strategy

Remember that Lambda functions are ephemeral and stateless. Whenever the scenario requires persistent, shared, or large-scale file storage accessible by multiple functions or teams, immediately identify Amazon EFS as the correct service and rule out EBS.

Community Votes

C
100%

100% of anonymous learners picked answer C. Votes are pick records left by other test-takers — they are not the verified answer.

Discussion 4 contributions

Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.

From public community threads 4

  1. chris_spencer 👍 3 Answered C
    Configure a function to mount an Amazon Elastic File System (Amazon EFS) file system to a local directory https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html
  2. Arnaud92 👍 2 Answered C
    Can't use EBS volumes with Lambda, used with EC2 only.
  3. albert_kuo 👍 1 Answered C
    C. Set up an Amazon Elastic File System (Amazon EFS) file system with mount targets in the central VPConfigure the Lambda functions to mount the EFS file system. Update the Lambda function execution roles to give the functions to access the EFS file system.
  4. komorebi 👍 2 Answered C
    Ansswer is c

Reader comments & corrections

No reader corrections yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Practice All DVA-C02 Questions

Access 100 questions with complete answers and detailed explanations.

View Full DVA-C02 Practice Test →

← Back to DVA-C02 Study Guide