
Answer-first summary for fast verification
Answer: 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.
## Explanation **Correct Answer: C** **Why Option C is correct:** 1. **Compute Savings Plan vs EC2 Instance Savings Plan:** - A **Compute Savings Plan** provides flexibility by applying to both EC2 instances and Lambda functions, offering savings across both services. This is ideal since the company uses both EC2 and Lambda. - An **EC2 Instance Savings Plan** only applies to EC2 instances and doesn't provide savings for Lambda functions. - Since the company wants to maximize savings on **all** application resources and expects Lambda usage to increase, Compute Savings Plan is the better choice. 2. **Network connectivity:** - Lambda functions need direct network access to EC2 instances in the private subnet. - Connecting Lambda functions to the **private subnet** that contains the EC2 instances provides the lowest latency and most secure connection. - This avoids going through NAT gateways or internet gateways, reducing latency and costs. 3. **Optimization:** - Optimizing Lambda functions' duration, memory usage, invocations, and data transfer helps reduce Lambda costs. **Why other options are incorrect:** - **Option A:** Uses EC2 Instance Savings Plan which doesn't save on Lambda costs, and doesn't optimize data transfer. - **Option B:** Uses EC2 Instance Savings Plan (no Lambda savings), connects to public subnet (higher latency and security risks), and requires NAT gateway for Lambda to access private EC2 instances. - **Option D:** Uses Compute Savings Plan (good), but keeps Lambda in Lambda service VPC which requires VPC endpoints or other connectivity solutions, increasing latency and complexity. **Key AWS Concepts:** - **Compute Savings Plan:** Applies to EC2, Lambda, and Fargate usage with flexibility across instance families, regions, and operating systems. - **Lambda VPC Connectivity:** Lambda functions can be configured to connect to VPC subnets, allowing direct access to resources in those subnets. - **Private vs Public Subnets:** Private subnets don't have internet gateways, providing better security and lower latency for internal communication.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
A company uses Amazon EC2 instances and AWS Lambda functions to run its application. The company has VPCs with public subnets and private subnets in its AWS account. The EC2 instances run in a private subnet in one of the VPCs. The Lambda functions need direct network access to the EC2 instances for the application to work.
The application will run for at least 1 year. The company expects the number of Lambda functions that the application uses to increase during that time. The company wants to maximize its savings on all application resources and to keep network latency between the services low.
Which solution will meet these requirements?
A
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.
B
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.
C
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.
D
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.