SOA-C02 Question 270
Single answerA company has an Amazon EC2 instance in a public subnet of a VPC, and the instance is unable to connect to the internet. The instance has a public IP address assigned, and the security group allows outbound traffic on all ports. What could be the cause of the connectivity issue?
- A
The route table associated with the subnet does not have a route for internet traffic through an internet gateway.
- B
The Elastic IP address is not associated with the instance.
- C
The Network Access Control List (NACL) associated with the subnet is blocking outbound traffic.
- D
The instance does not have an IAM role attached that allows internet access.
Show answer and explanation
Correct answer: A
Explanation
To enable internet connectivity for an instance in a public subnet, the subnet's route table must have a route to an internet gateway for 0.0.0.0/0 traffic. Without this configuration, the instance cannot send traffic to or receive traffic from the internet, even if it has a public IP address and the security group allows outbound traffic.
- A. Correct.
Correct. For an instance in a public subnet to access the internet, the route table must have a route pointing to an internet gateway for internet-bound traffic.
- B. Incorrect.
Incorrect. The instance is already assigned a public IP address, so associating an Elastic IP is not necessary in this scenario.
- C. Incorrect.
Incorrect. NACLs are stateful by default, and the question does not indicate any specific changes to the default NACL behavior. Outbound traffic should not be blocked by default.
- D. Incorrect.
Incorrect. IAM roles are used for granting permissions to AWS services, not for internet connectivity.