- Newest
- Most votes
- Most comments
When CloudFront routes requests to an internal ALB via a VPC origin, you will incur the standard CloudFront request charges. These charges are based on the AWS Region you've configured for your origin and not based on the CloudFront edge location serving the content.
If you're using Origin Shield with your CloudFront distribution, additional charges would apply for requests that go through Origin Shield as an incremental layer. Origin Shield is charged as a request fee for each request that comes from another regional cache to your Origin Shield.
For requests between CloudFront and your internal ALB, there may also be data transfer costs to consider. When traffic crosses Availability Zones within your VPC, a charge of $0.01 per GB typically applies for both incoming and outgoing traffic. However, if your CloudFront distribution and ALB are in the same Availability Zone, these cross-AZ charges would not apply.
To track and correlate requests between CloudFront and your ALB, note that CloudFront adds a unique X-Amz-Cf-Id header to each request, while the ALB adds a unique X-Amzn-Trace-Id. These can be useful for request tracking, though the ALB access logs cannot be modified to include the CloudFront header.
Sources
WAF on ALB or CloudFront ? | AWS re:Post
Exploring Data Transfer Costs for AWS Network Load Balancers | Networking & Content Delivery
Amazon CloudFront CDN - Plans & Pricing - Try For Free
CloudFront - ALB log mapping | AWS re:Post
Relevant content
asked a year ago
asked 4 years ago
asked a year ago
