ACloud Guru Certified Cloud Practitioner Practice Exam

Disable ads (and more) with a membership for a one time $2.99 payment

Prepare for the ACloud Guru Certified Cloud Practitioner Exam with flashcards and multiple choice questions. Each question includes hints and explanations to ensure you're ready for your certification!

Practice this question and more.


What component is required to allow EC2 instances in a public subnet to access the internet?

  1. VPC Peering

  2. NAT Gateway

  3. Internet Gateway

  4. API Gateway

The correct answer is: Internet Gateway

To allow EC2 instances in a public subnet to access the internet, an Internet Gateway is essential. An Internet Gateway enables communication between AWS resources within a VPC and the internet. By attaching an Internet Gateway to a VPC, you provide a way for instances with public IP addresses to send and receive traffic from the internet. When instances in a public subnet are configured with a public IP address, they route their outbound traffic through the Internet Gateway to reach the internet. Additionally, while receiving traffic from the internet, the Internet Gateway also allows incoming traffic to reach those instances, provided that security group and network ACL rules permit it. In contrast, other options like VPC Peering, NAT Gateway, and API Gateway serve different purposes. VPC Peering connects two VPCs but does not provide direct access to the internet. A NAT Gateway is used to allow instances in a private subnet to access the internet while preventing inbound traffic from the internet. API Gateway is a service that enables developers to create, publish, maintain, monitor, and secure APIs, not a specific mechanism for internet access. Therefore, the use of an Internet Gateway is the correct solution for EC2 instances in a public subnet to access the internet effectively.