Support for Multi-Origin Distribution in CloudFront with Copilot CLI
We are currently facing a limitation in configuring AWS CloudFront distributions through the Copilot CLI, specifically regarding the integration of multiple service types (static site and load-balanced web service) within a single distribution. The primary goal is to adhere to host header security best practices by having multiple origins with distinct cache behaviors on the same CloudFront distribution.
The current setup does not allow adding additional cache behaviors for different paths when the Load Balanced Web Service is used. This restriction hampers the ability to efficiently serve static assets alongside dynamic content under a unified CloudFront distribution.
To facilitate better architecture and security, we require the capability to configure multiple origins and corresponding cache behaviors within a single CloudFront distribution via the Copilot CLI. This feature is crucial for achieving optimal performance and security by allowing distinct caching strategies for static and dynamic content.
We kindly request the addition of this feature to support complex distributions and enhance the flexibility and security of applications deployed with the Copilot CLI.
Hey @Raffasolaries thanks for the feature request! That makes sense to me. Meanwhile, I think yaml patch (or cdk overrides if you are more familiar with cdk) may help unblock you!