cdk-constructs
cdk-constructs copied to clipboard
Feature Request: More configurability for CloudFront with StaticWebsite
We use React Router on pages that we're deploying with StaticWebsite.
This means we're deploying a single index.html but all paths need to map to it so the client side routing can work. We normally do this like so:
https://hackernoon.com/hosting-static-react-websites-on-aws-s3-cloudfront-with-ssl-924e5c134455
e.g. set up a custom error page with a 200 response and index.html.
I'm proposing to expose errorConfigurations as an optional field in StaticWebsiteProps which we pass directly to the CloudFrontWebDistribution constructor.
Another alternative would be to expose something like cloudFrontSettings which allows users to override all CloudFront configuration as exposed by CDK directly with a spread, but that feels a bit heavy handed when we're only allowing a couple of options at the moment, hence the proposal above.
Take a look at #70 .