Which solution will meet these requirements?
Purchase an EC2 Instance Savings Plan. Connect the Lambda functions to the private subnets that contain the EC2 instances.
Purchase an EC2 Instance Savings Plan. Connect the Lambda functions to new public subnets in the same VPC where the EC2 instances run.
Purchase a Compute Savings Plan. Connect the Lambda functions to the private subnets that contain the EC2 instances.
Purchase a Compute Savings Plan. Keep the Lambda functions in the Lambda service VPC.
Explanations:
An EC2 Instance Savings Plan provides cost savings for EC2 usage, but it does not apply to AWS Lambda. Furthermore, connecting Lambda functions to private subnets would require a VPC endpoint for Lambda, which can add complexity and costs.
While an EC2 Instance Savings Plan is appropriate for EC2 instances, using public subnets for Lambda functions does not ensure direct access to private EC2 instances without additional network configurations, which may incur additional costs.
A Compute Savings Plan provides flexibility for both EC2 and Lambda usage. By connecting Lambda functions to the private subnets, they can directly access the EC2 instances, optimizing network performance while minimizing costs through the savings plan.
Although a Compute Savings Plan is suitable, keeping Lambda functions in the Lambda service VPC without connecting to the private subnets means they cannot directly access the EC2 instances. This could lead to additional costs or complications in accessing resources.