No history yet

Introduction to VPC Endpoints

Connecting Within the Cloud

Imagine your Virtual Private Cloud (VPC) is a private, fenced-in yard for your AWS resources, like EC2 instances. Now, suppose an instance inside your yard needs to access a public AWS service, like Amazon S3. By default, that request has to leave your yard, go out onto the public street (the internet), and then knock on the front door of the S3 service. This works, but it's not the most secure or efficient route.

Amazon Virtual Private Cloud (VPC) lets you provision a logically isolated section of the AWS Cloud where you can launch AWS resources in a virtual network that you define.

Sending traffic over the public internet can expose it to potential threats and might incur data transfer costs. What if you could create a private, direct path from your VPC to AWS services, keeping all the traffic within the secure AWS network? That's exactly what VPC endpoints are for.

A VPC endpoint enables private connections between your VPC and supported AWS services, powered by a technology called AWS PrivateLink. It ensures your network traffic doesn't traverse the public internet, which improves security and can provide more reliable network performance. There are two main types of endpoints to know.

Two Flavors of Endpoints

VPC endpoints come in two varieties: gateway endpoints and interface endpoints. They accomplish the same goal but work differently.

Gateway Endpoints are the older of the two. Think of a gateway endpoint as a special gate you add to your VPC for specific services. It works by creating a target in your route table for traffic destined for the supported service.

The key thing to remember about gateway endpoints is their limited service support. They can only be used for Amazon S3 and DynamoDB. They don't use security groups but are controlled by VPC endpoint policies and S3 bucket or DynamoDB table policies.

Interface Endpoints are more versatile. An interface endpoint is an Elastic Network Interface (ENI) with a private IP address from the IP address range of your subnet. This ENI serves as a private entry point for traffic going to a supported AWS service.

Unlike gateway endpoints, interface endpoints support a wide range of AWS services, including API Gateway, Kinesis, and many more. Because they are network interfaces living inside your subnet, you can use security groups to control the traffic to and from the endpoint, adding an extra layer of security.

FeatureGateway EndpointInterface Endpoint (AWS PrivateLink)
How it WorksA target in your route tableAn Elastic Network Interface (ENI)
ServicesAmazon S3, DynamoDBMost AWS services
SecurityEndpoint policies, resource policiesSecurity Groups, endpoint policies
Access FromResources within the VPCVPC, on-premises (via VPN/Direct Connect)
BillingNo charge for the endpoint itselfHourly charge + data processing fees

Why Use Endpoints?

Using VPC endpoints offers several clear advantages for your cloud architecture.

First and foremost is improved security. By keeping traffic within the AWS private network, you significantly reduce the risk of exposure to internet-based threats. You're no longer sending sensitive data over the public internet to reach other AWS services.

Second is better performance. The AWS global network is highly reliable and optimized for low latency. Routing traffic through it instead of the public internet can lead to more consistent and dependable network performance for your applications.

Finally, while interface endpoints have an associated cost, you may save on data transfer charges. Data transfer within the same AWS Region is often cheaper than data transfer out to the internet, which can lead to cost savings in high-traffic applications.

Let's review what you've learned.

Quiz Questions 1/5

What is the primary purpose of a VPC endpoint?

Quiz Questions 2/5

Which of the following are the two main types of VPC endpoints?