A company hosts a three-tier web application in the AWS Cloud. A Multi-AZ Amazon RDS for MySQL server forms the database layer. Amazon ElastiCache forms the cache layer. The company wants a caching strategy that adds or updates data in the cache when a customer adds an item to the database. The data in the cache must always match the data in the database.
Which solution will meet these requirements?
A public NAT gateway enables instances in a private subnet to send outbound traffic to the internet, while preventing the internet from initiating connections with the instances. A public NAT gateway requires an elastic IP address and a route to the internet gateway for the VPC. A private NAT gateway enables instances in a private subnet to connect to other VPCs or on-premises networks through a transit gateway or a virtual private gateway. A private NAT gateway does not require an elastic IP address or an internet gateway. Both private and public NAT gateways map the source private IPv4 address of the instances to the private IPv4 address of the NAT gateway, but in the case of a public NAT gateway, the internet gateway then maps the private IPv4 address of the public NAT gateway to the elastic IP address associated with the NAT gateway. When sending response traffic to the instances, whether it's a public or private NAT gateway, the NAT gateway translates the address back to the original source IP address.
Creating public NAT gateways in the same private subnets as the EC2 instances (option A) is not a valid solution, as the NAT gateways would not have a route to the internet gateway. Creating private NAT gateways in the same private subnets as the EC2 instances (option B) is also not a valid solution, as the instances would not be able to access the internet through the private NAT gateways. Creating private NAT gateways in public subnets in the same VPCs as the EC2 instances (option D) is not a valid solution either, as the internet gateway would drop the traffic from the private NAT gateways.
Therefore, the only valid solution is to create public NAT gateways in public subnets in the same VPCs as the EC2 instances (option C), as this would allow the instances to access the internet through the public NAT gateways and the internet gateway.Reference:
NAT gateways - Amazon Virtual Private Cloud
NAT gateway use cases - Amazon Virtual Private Cloud
Amazon Web Services -- Introduction to NAT Gateways
What is AWS NAT Gateway? - KnowledgeHut
Callie
5 months agoShawn
5 months agoLashandra
5 months agoGilma
5 months agoMary
6 months agoNikita
6 months agoSusana
6 months agoLore
6 months agoZana
6 months agoGracia
6 months agoMarisha
6 months agoBrianne
6 months agoDelsie
7 months agoSage
7 months agoSelma
7 months agoYuonne
7 months agoCecil
11 months agoOlive
10 months agoViva
10 months agoTuyet
10 months agoFrank
11 months agoMyra
11 months agoShaunna
10 months agoNilsa
10 months agoLuke
11 months agoGwen
12 months agoShonda
10 months agoMilly
11 months agoGerman
11 months agoTroy
12 months agoShaniqua
10 months agoAmina
10 months agoKirk
10 months agoLelia
11 months agoElfrieda
11 months agoJosefa
11 months agoTammara
11 months agoAlethea
1 year agoSabina
12 months agoLisandra
12 months agoCatherin
1 year agoKenneth
1 year agoJackie
1 year ago