--- title: "VPC Endpoint" type: concept tags: - AWS - Networking - Security date: 2026-04-14 --- ## Definition VPC Endpoint 是 AWS 提供的一项功能,允许在 VPC 内部通过私有 IP 地址安全地访问 AWS 服务,而无需经过公网、互联网网关、NAT 设备或 VPN 连接。 ## Two Types ### Interface Endpoint - 使用 AWS PrivateLink 技术,在 VPC 中作为弹性网络接口(ENI)部署 - 为 AWS 服务(如 S3、DynamoDB、SES SMTP 等)提供私有连接 - 支持通过安全组控制访问 ### Gateway Endpoint - 用于 S3 和 DynamoDB - 通过路由表中的目标条目将流量路由到 AWS 服务 - 免费使用 ## Key Use Cases - **SES SMTP 集成**:在应用 VPC 中配置 VPC Endpoint,使应用程序可以在不访问公网的情况下通过私有连接与 SES SMTP 服务通信 - **S3 访问**:在私有子网中的 EC2 实例通过 Gateway Endpoint 安全访问 S3,避免流量经公网 - **Secrets Manager 访问**:通过 Interface Endpoint 安全地访问 Secrets Manager,无需公网连接 ## Why Use VPC Endpoints 1. **安全**:流量不经过公网,消除互联网暴露面 2. **低延迟**:私有 IP 直连,减少网络跳数 3. **合规**:满足严格的网络隔离和合规要求 4. **成本**:Gateway Endpoint 免费,Interface Endpoint 费用低于 NAT Gateway ## Related Concepts - [[AWS-PrivateLink]]:VPC Endpoint 背后使用的核心技术 - [[Infrastructure-as-Code]]:Terraform 模块可自动化 VPC Endpoint 的创建