SAA-C03 practice question 15 of 35

A company runs its application by using Amazon EC2 instances and AWS Lambda functions. The EC2 instances run in private subnets of a VPC. The Lambda…

Full set: 972 questions

Domain Design Cost-Optimized Architectures

A company runs its application by using Amazon EC2 instances and AWS Lambda functions. The EC2 instances run in private subnets of a VPC. The Lambda functions need direct network access to the EC2 instances for the application to work. The application will run for 1 year. The number of Lambda functions that the application uses will increase during the 1-year period. The company must minimize costs on all application resources. Which solution will meet these requirements?
Answer options
A: Purchase an EC2 Instance Savings Plan. Connect the Lambda functions to the private sub-nets that contain the EC2 instances.
B: Purchase an EC2 Instance Savings Plan. Connect the Lambda functions to new public sub-nets in the same VPC where the EC2 instances run.
C: Purchase a Compute Savings Plan. Connect the Lambda functions to the private subnets that contain the EC2 instances. Correct answer
D: Purchase a Compute Savings Plan. Keep the Lambda functions in the Lambda service VPC.
Correct Answer:
C. Purchase a Compute Savings Plan. Connect the Lambda functions to the private subnets that contain the EC2 instances.
Explanation

The solution must address two key requirements: cost optimization for all compute resources (EC2 and Lambda) and direct network access from Lambda to EC2 instances in a private subnet. A Compute Savings Plan is the most suitable cost-optimization strategy as it provides discounts on both Amazon EC2 and AWS Lambda usage, accommodating the expected increase in Lambda functions. This is more comprehensive than an EC2 Instance Savings Plan, which only covers EC2. For direct network access, the Lambda functions must be configured to connect to the VPC where the EC2 instances reside. Placing the Lambda function's network interfaces in the same private subnets as the EC2 instances is the most direct and secure method to enable this communication.

Why Incorrect

A. An EC2 Instance Savings Plan does not provide cost savings for AWS Lambda, failing to meet the requirement to minimize costs on all application resources.
B. This option is incorrect for two reasons: an EC2 Instance Savings Plan does not cover Lambda, and connecting Lambda to public subnets is an unnecessary security risk.
D. If Lambda functions remain in the default service VPC, they cannot directly access EC2 instances within the customer's private VPC, violating a core networking requirement.

References

1. AWS Savings Plans User Guide: Under "Overview of Savings Plans

" the documentation specifies the coverage for different plans. It states

"Compute Savings Plans... automatically apply to EC2 instance usage... These plans also apply to Fargate and Lambda usage." In contrast

"EC2 Instance Savings Plans... only apply to EC2 instance usage." This supports the choice of a Compute Savings Plan to cover both resource types.

Source: AWS Savings Plans User Guide

"What are Savings Plans?"

"Savings Plans types" section.

2. AWS Lambda Developer Guide: The guide explains how to grant Lambda functions access to resources within a VPC. It states

"You can configure a function to connect to private subnets in a virtual private cloud (VPC) in your AWS account. Use Amazon Virtual Private Cloud (Amazon VPC) to create a private network for resources such as databases

cache instances

or internal services." This confirms that connecting Lambda to the VPC's subnets is the correct approach for network access.

Source: AWS Lambda Developer Guide

"Networking and VPC"

"Configuring VPC access for a Lambda function" section.

Scroll to Top