cdk-constructs icon indicating copy to clipboard operation
cdk-constructs copied to clipboard

Feature Request: More configurability for CloudFront with StaticWebsite

Open thekevinbrown opened this issue 4 years ago • 1 comments

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.

thekevinbrown avatar Feb 25 '21 23:02 thekevinbrown

Take a look at #70 .

hupe1980 avatar Feb 26 '21 06:02 hupe1980