Which solution will meet these requirements?
Purchase an EC2 Instance Savings Plan Optimize the Lambda functions’ duration and memory usage and the number of invocations. Connect the Lambda functions to the private subnet that contains the EC2 instances.
Purchase an EC2 Instance Savings Plan Optimize the Lambda functions’ duration and memory usage, the number of invocations, and the amount of data that is transferred. Connect the Lambda functions to a public subnet in the same VPC where the EC2 instances run.
Purchase a Compute Savings Plan. Optimize the Lambda functions’ duration and memory usage, the number of invocations, and the amount of data that is transferred. Connect the Lambda functions to the private subnet that contains the EC2 instances.
Purchase a Compute Savings Plan. Optimize the Lambda functions’ duration and memory usage, the number of invocations, and the amount of data that is transferred. Keep the Lambda functions in the Lambda service VPC.
Explanations:
While purchasing an EC2 Instance Savings Plan can help save costs for the EC2 instances, it doesn’t directly address the requirement to connect the Lambda functions to the private subnet. The Lambda functions must have access to the private subnet where the EC2 instances are located for direct network access.
Purchasing an EC2 Instance Savings Plan is not the optimal choice here, as it doesn’t cover the Lambda functions effectively. Moreover, connecting the Lambda functions to a public subnet is not suitable since the EC2 instances are in a private subnet, which limits direct access. This setup would lead to increased latency and potentially complicate network routing.
A Compute Savings Plan provides flexibility for both EC2 and Lambda usage, making it suitable for a growing number of Lambda functions over time. By optimizing the Lambda functions and connecting them to the private subnet, it ensures low latency and direct network access to the EC2 instances, aligning with the company’s needs.
Although a Compute Savings Plan is a good choice for flexibility and cost savings, keeping the Lambda functions in the Lambda service VPC without proper connectivity to the EC2 instances in the private subnet would hinder direct access. The configuration doesn’t meet the requirement for low-latency connections between Lambda and EC2.