How to Configure AWS CloudFront to Cache Responses Based on Host Header Value?
I’m currently using AWS CloudFront to distribute requests to an Application Load Balancer (ALB), which then forwards them to EC2 instances. I need to configure caching based on the Host header value. Specifically:
Calling a Lambda from a CloudFront function?
My current situation is that we have a 3rd-party content provider with fairly outrageous CDN fees, so we’re front-ending them with CloudFront. However, the CDN URL is not tenant-specific so I’ve implemented a CF Function that checks for our tenant/project IDs in the URL before fetching from the backend. However our devs want rolling Dev->Staging->Prod projects from this provider, so it will no longer be a static list of IDs and no one wants to be responsible for hand-editing that list all the time.