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
6 months agoShawn
6 months agoLashandra
7 months agoGilma
7 months agoMary
7 months agoNikita
7 months agoSusana
7 months agoLore
8 months agoZana
8 months agoGracia
8 months agoMarisha
8 months agoBrianne
8 months agoDelsie
8 months agoSage
8 months agoSelma
8 months agoYuonne
8 months agoCecil
1 year agoOlive
11 months agoViva
11 months agoTuyet
12 months agoFrank
1 year agoMyra
1 year agoShaunna
11 months agoNilsa
12 months agoLuke
1 year agoGwen
1 year agoShonda
12 months agoMilly
1 year agoGerman
1 year agoTroy
1 year agoShaniqua
12 months agoAmina
12 months agoKirk
12 months agoLelia
1 year agoElfrieda
1 year agoJosefa
1 year agoTammara
1 year agoAlethea
1 year agoSabina
1 year agoLisandra
1 year agoCatherin
1 year agoKenneth
1 year agoJackie
1 year ago