Virtual Private Cloud Quiz
You need to host a set of web servers and database servers in an AWS VPC. Which of the following is a best practice in designing a multi-tier infrastructure?
A. Use a public subnet for the web tier and a public subnet for the database layer.
B. Use a public subnet for the web tier and a private subnet for the database layer.
C. Use a private subnet for the web tier and a private subnet for the database layer.
D. Use a private subnet for the web tier and a public subnet for the database layer.
B. Use a public subnet for the web tier and a private subnet for the database layer.
The ideal setup is to ensure that the web server is hosted in the public subnet so that it can be accessed by users on the internet. The database server can be hosted in the private subnet.The below diagram from AWS Documentation shows how this can be setup:
For more information on public and private subnets in AWS, please visit the following URL:https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Scenario2.html