Gateway endpoint versus interface endpoint: when do you use which?
IntermediateScenarioVPC & Cloud Network Design
Answer
Situation read → Both keep traffic off the internet but work very differently.
What I'd do →
- Gateway endpoints exist only for S3 and DynamoDB and work as route table entries (free)
- Interface endpoints are ENIs with private IPs in your subnets powered by PrivateLink and cost hourly plus per GB
- Interface endpoints are reachable from on-prem over VPN or Direct Connect, gateway endpoints are not
- Enable private DNS so
ssm.eu-west-1.amazonaws.comresolves to the ENI IPs - Secure with a security group allowing 443 from the VPC CIDR
Why → The gateway type is a routing construct, the interface type is a network interface, which is why only the latter extends to on-prem.
Interview tip → Mention S3 interface endpoints exist too, for on-prem access to S3 without public IPs.
More on VPC & Cloud Network Design
What makes a subnet public versus private in AWS?BeginnerExplain internet gateway versus NAT gateway and when you use each.BeginnerPrivate instances need to pull packages from the internet but must not be reachable from it. What do you set up?BeginnerWhy shouldn't production run in the default VPC?BeginnerPublic IP, Elastic IP and private IP: how do they differ on EC2?BeginnerWhy use SSM Session Manager instead of a bastion host?Beginner