Q30 — AWS DVA-C02 Ch.2

Question 30 of 100 | ← Chapter 2

A developer is creating an AWS Lambda function that runs in a VPC. An Amazon S3 event triggers the Lambda function when objects are uploaded to an S3 bucket. The Lambda function processes the object and generates some analytical results, which are written to a file. Each processed object also generates a log entry, which is written to another file. Other Lambda functions, AWS services, and on-premises resources must be able to access both the results file and the log file. Each log entry must also be appended to a shared log file. The developer needs a solution that enables shared file access and allows appending results to existing files. Which solution should the developer use to meet these requirements?

Correct Answer: A. Create an Amazon Elastic File System (Amazon EFS) file system. Mount the EFS file system in Lambda. Store the results file and log file on the mount point. Append log entries to the log file.

Explanation

Option A proposes creating an Amazon Elastic File System (Amazon EFS) file system and mounting it in Lambda. Since EFS is a shared file storage service, it easily supports concurrent access from multiple Lambda functions and other resources. Developers can store results and log files on the EFS mount point, enabling shared access, and append log entries to the same shared log file. In contrast, Option B incorrectly suggests using Amazon EBS with multi-attach — EBS volumes are designed for attachment to a single EC2 instance and are not suitable for shared access across Lambda functions. Options C and D refer to local directories (/tmp and /opt), which are ephemeral and isolated per Lambda invocation and thus unsuitable for cross-function sharing. Therefore, A is the most appropriate solution.