Which solution will meet these requirements MOST cost-effectively?
Create a new EFS file system in the primary account. Use AWS DataSync to copy the contents of the original EFS file system to the new EFS file system.
Create a VPC peering connection between the VPCs that are in the primary account and the secondary account.
Create a second Lambda function in the secondary account that has a mount that is configured for the file system. Use the primary account’s Lambda function to invoke the secondary account’s Lambda function.
Move the contents of the file system to a Lambda layer. Configure the Lambda layer’s permissions to allow the company’s secondary account to use the Lambda layer.
Explanations:
Creating a new EFS file system in the primary account and using AWS DataSync to copy data introduces unnecessary complexity and cost. The requirement specifies accessing files in the secondary account’s EFS, and copying data to a new EFS would duplicate storage costs and reduce scalability.
A VPC peering connection allows the Lambda function in the primary account to access the EFS file system in the secondary account. This solution enables the Lambda function to scale and access files efficiently without needing to move data or add extra layers.
Using a secondary Lambda function in the secondary account adds unnecessary complexity and potential latency. This solution requires invoking another Lambda function and managing cross-account permissions, which is less efficient than directly accessing the EFS file system.
Moving the contents of the file system to a Lambda layer is not feasible because Lambda layers are meant for small dependencies, not large file systems. Additionally, it does not address the scalability or cost-effectiveness of accessing large, dynamic file data stored in EFS.