Which solution should the developer use to meet these requirements?
Create an Amazon Elastic File System (Amazon EFS) file system. Mount the EFS file system in Lambda. Store the result files and log file in the mount point. Append the log entries to the log file.
Create an Amazon Elastic Block Store (Amazon EBS) Multi-Attach enabled volume. Attach the EBS volume to all Lambda functions. Update the Lambda function code to download the log file, append the log entries, and upload the modified log file to Amazon EBS.
Create a reference to the /tmp local directory. Store the result files and log file by using the directory reference. Append the log entry to the log file.
Create a reference to the /opt storage directory. Store the result files and log file by using the directory reference. Append the log entry to the log file.
Explanations:
Amazon Elastic File System (EFS) allows for file storage that can be accessed by multiple AWS services, including Lambda functions. It supports appending data to files, which meets the requirement for shared access and log entry appending.
Amazon Elastic Block Store (EBS) does not support multi-attach for Lambda functions and cannot be attached to multiple instances concurrently in the same way as EFS. This limits its use for shared access and appending logs.
The /tmp directory is ephemeral storage specific to each Lambda execution environment, meaning it cannot be shared across different Lambda invocations or functions. Log entries cannot persist beyond the life of the function invocation.
The /opt directory is also not suitable for shared access among multiple Lambda functions. It is meant for function deployment packages and does not provide persistent or shared storage capabilities needed for appending logs.