Q73 — AWS DVA-C02 Ch.3
Question 73 of 100 | ← Chapter 3
A developer is creating an AWS Lambda function in VPC mode. An Amazon S3 event invokes the Lambda function when objects are uploaded to an S3 bucket. The Lambda function processes the object and produces some analytical results, which are written to a file. Each processed object also generates a log entry, which is written to a file. Other Lambda functions, AWS services, and on-premises resources must have access to both the results file and the log file. Each log entry must also be appended to the same shared log file. The developer needs a solution that supports shared file access and allows appending results to existing files. Which solution should the developer use to meet these requirements?
- 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 in the mount point. Append log entries to the log file. ✓
- B. Create an Amazon Elastic Block Store (Amazon EBS) volume with multi-attach enabled. Attach the EBS volume to all Lambda functions. Update the Lambda function code to download the log file, append the log entry, and upload the modified log file back to Amazon EBS.
- C. Create a reference to the /tmp local directory. Use the directory reference to store the results file and log file. Append log entries to the log file.
- D. Create a reference to the /opt storage directory. Use the directory reference to store the results file and log file. Append log entries to the log file.
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 in the mount point. Append log entries to the log file.
Explanation
AWS Lambda functions are serverless and typically do not interact directly with persistent storage systems, but shared file access can be achieved using network file systems like Amazon Elastic File System (EFS). EFS supports concurrent file access across multiple EC2 instances and Lambda functions, making it suitable for scenarios requiring simultaneous read/write operations. In Option A, creating and mounting an EFS file system in Lambda enables multiple Lambda functions and AWS services to access and modify shared files, satisfying the requirements. Option B is invalid because EBS does not support cross-instance sharing and is incompatible with Lambda. Options C and D refer to /tmp and /opt — temporary directories in Lambda that are not shared across invocations and may be deleted after execution, making them unsuitable. Therefore, the correct answer is A. 【Lantern Certification: swufelp1999】