🟡
CloudFront – ALB or EC2 as an Origin (VPC Origins)
Key Concepts
- Enables delivery of content from applications hosted in private VPC subnets.
- Removes the need to expose these resources directly to the public internet.
- Provides secure access over AWS’s private network.
Supported Private Origins
- Application Load Balancer (ALB)
- Network Load Balancer (NLB)
Architecture Flow
- Users send requests to CloudFront.
- The nearest CloudFront edge location receives the request.
- CloudFront routes the request securely to the VPC origin.
- Inside the VPC, traffic is directed to the appropriate private resource (ALB, NLB, or EC2).
- Content is returned to the edge location, cached, and served to the user.
Benefits
- Improved security by keeping backend resources private.
- Better performance through edge caching and reduced latency.