Can a CloudFront origin be another CloudFront distribution?
Are there any issues with chaining CloudFront distributions like this?
Use case: An application that has 2 origins — an S3 bucket and an API. The API will be used by other projects so it has its own CloudFront and we want its cache to be available to those projects.
project1.example.com -> api.example.com
project2.example.com -> api.example.com
If you just want to call the API with multiple names, there is no need for second distribution but you could add alternative names to your "api" distribution. https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/CNAMEs.html
I'm not sure how good idea is to have 2 levels of caching but you could configure "api" distribution as custom origin for "project" distributions. I recall there might be some loop-detection in Cloudfront not allowing this, but should be able to work-a-round by limiting origin request headers you forward from "project" distribution to "api" distribution.
OAI or not OAI for serving a static website in S3 using CloudFrontasked a month ago
Data transfer out s3-cloudfrontAccepted AnswerMODERATORasked 3 years ago
CloudFront - One or more of the CNAMEs you provided are already associated with a different resourceAccepted Answerasked 3 years ago
Seamlessly switch between CloudFront distributions using Route 53?Accepted Answerasked 2 years ago
CNAMEAlreadyExistsasked a year ago
Can a CloudFront origin be another CloudFront distribution?asked a month ago
Protect HTTP Api Gateway with WAF
protect http API GW when CF has S3 as origin
CloudFront Origin PathAccepted Answerasked 4 months ago
CloudFront with EIP as originAccepted Answerasked 2 years ago