A SysOps Administrator is configuring Amazon EC2 instances in a private subnet to securely communicate with Amazon SNS without traversing the public internet. The administrator creates an Interface VPC Endpoint for Amazon SNS (com.amazonaws.us-east-1.sns) in the VPC. The VPC has both DNS resolution and DNS hostnames enabled. However, the EC2 instances still fail to connect to Amazon SNS, resulting in connection timeouts. Which configuration change will resolve this issue?
- Modify the security group associated with the Interface VPC Endpoint to allow inbound HTTPS traffic on port 443 from the security group of the EC2 instances.Answer
- BAdd a route to the private subnet's route table that targets the Interface VPC Endpoint using the Amazon SNS service prefix list.
- CAdd a route to the private subnet's route table directing Amazon SNS traffic to a NAT Gateway in a public subnet.
- DAttach an Internet Gateway to the VPC and add a route in the private subnet's route table pointing 0.0.0.0/0 to the Internet Gateway.
Answer
Modify the security group associated with the Interface VPC Endpoint to allow inbound HTTPS traffic on port 443 from the security group of the EC2 instances.
The correct option is to modify the security group associated with the Interface VPC Endpoint to allow inbound HTTPS traffic on port 443 from the security group of the EC2 instances. Interface VPC Endpoints place Elastic Network Interfaces (ENIs) inside the VPC subnets. These ENIs are associated with security groups. Because the EC2 instances communicate with the SNS endpoint over HTTPS (port 443), the security group on the endpoint ENIs must explicitly allow inbound traffic from the EC2 instances.
Step-by-Step Solution
Key Concept
Interface VPC Endpoints (AWS PrivateLink) require appropriate security group configurations to allow inbound traffic on port 443 from consumer resources, and they do not rely on route table updates.