A legacy application was migrated to AWS and runs on three EC2 instances (one in each of three AZs) in private subnets. These instances are targets for an Application Load Balancer (ALB) in three public subnets. The application must call on-premises systems that accept traffic only from a single company IP address. The security team has brought only that one IP to the cloud and allocated an Elastic IP for it. The solution must allow the application to reach on-premises systems and automatically handle failures. Which design meets these requirements?
Choose an answer
Tap an option to check your answer.
Correct answer: Deploy a single NAT gateway in a public subnet and assign the Elastic IP to it. Use Amazon CloudWatch with a custom metric to monitor NAT gateway health. If the NAT gateway becomes unhealthy, invoke an AWS Lambda function to create a new NAT gateway in another subnet and assign the Elastic IP to that new NAT gateway..
Why this is the answer
The correct solution uses a single NAT Gateway with an Elastic IP (EIP) because the on-premises system requires a single, consistent source IP address. NAT Gateways are highly available within their Availability Zone (AZ), but a failure of the AZ or the NAT Gateway itself would disrupt connectivity. CloudWatch with a custom metric and a Lambda function provides an automated failover mechanism to re-create the NAT Gateway in another AZ and reassign the EIP, ensuring continuous connectivity and meeting the automatic failure handling requirement. Option 1 is incorrect because assigning a single EIP to multiple NAT Gateways is not possible, and it would not provide a single source IP. Option 2 is incorrect because an NLB is for inbound traffic, not outbound, and it wouldn't provide a single source IP for the EC2 instances. Option 4 is incorrect because an ALB is for inbound traffic, not outbound, and cannot be directly assigned an EIP in this manner for outbound traffic.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed