SOA-C02 Question 269
Single answerAn application hosted on an EC2 instance in a public subnet of a VPC is unable to connect to the internet. The security group and network ACLs are configured to allow outbound traffic. The route table for the subnet has the following entry: Destination: 0.0.0.0/0, Target: igw-12345678 (Internet Gateway). What could be the cause of the issue?
- A
The EC2 instance does not have a public IP address or Elastic IP associated with it.
- B
The Internet Gateway is not attached to the VPC.
- C
The security group does not allow inbound traffic on port 80.
- D
The NAT Gateway is misconfigured.
Show answer and explanation
Correct answer: A
Explanation
For an EC2 instance in a public subnet to access the internet, it must meet three conditions: 1) The subnet must have a route table entry pointing to an Internet Gateway, 2) The Internet Gateway must be attached to the VPC, and 3) The EC2 instance must have a public IP address or Elastic IP associated with it. In this case, the missing public IP or Elastic IP is the likely root cause of the connectivity issue.
- A. Correct.
Correct: An EC2 instance in a public subnet must have a public IP address or Elastic IP associated with it to communicate with the internet. Without it, the instance cannot send or receive traffic over the Internet Gateway.
- B. Incorrect.
Incorrect: The route table already has an entry pointing to the Internet Gateway (igw-12345678), which implies that the Internet Gateway is attached to the VPC.
- C. Incorrect.
Incorrect: The security group configurations for outbound traffic are already mentioned as correct in the scenario, and port 80 is relevant only for inbound HTTP traffic.
- D. Incorrect.
Incorrect: A NAT Gateway is not required for instances in a public subnet to access the internet. It is used for private subnet instances to access the internet.