A SysOps Administrator has configured an Interface VPC Endpoint for the Amazon EC2 service (com.amazonaws.us-east-1.ec2) to allow Amazon EC2 instances in a private subnet to call the Amazon EC2 API. The VPC has DNS support and DNS hostnames enabled, and the Interface VPC Endpoint has Private DNS enabled. The EC2 instances are associated with a security group that allows all outbound traffic. However, when attempting to run the command 'aws ec2 describe-instances' from one of the instances, the command hangs and eventually times out. Which of the following is the most likely cause of this issue?
- The security group associated with the Interface VPC Endpoint does not allow inbound TCP port 443 traffic from the security group of the EC2 instances.Answer
- BThe route table associated with the private subnet does not contain a route that targets the Interface VPC Endpoint ID for the destination traffic.
- CThe private subnet's Network ACL does not have a rule allowing outbound traffic to the AWS public IP range for the EC2 service.
- DThe EC2 instances are unable to resolve the public DNS endpoint of the EC2 service because there is no route to an Internet Gateway in the route table.
Answer
The security group associated with the Interface VPC Endpoint does not allow inbound TCP port 443 traffic from the security group of the EC2 instances.
The correct answer is that the security group associated with the Interface VPC Endpoint does not allow inbound TCP port 443 traffic from the security group of the EC2 instances. Interface VPC Endpoints create Elastic Network Interfaces (ENIs) inside the subnet. The security group attached to these ENIs acts as a firewall. Since the AWS CLI communicates over HTTPS, the endpoint's security group must permit inbound traffic on TCP port 443 from the EC2 instances or their subnet CIDR.
Step-by-Step Solution
Key Concept
Security group configuration for Interface VPC Endpoints (AWS PrivateLink)