The 'create' command creates an S3 bucket configured with static website hosting and a cloudfront distribution with a custom origin (rather than origin of type 'S3').
The issue for Single Page Applications (SPAs) that require all routes to redirect to index.html is that the setup respects the S3 static website hosting rules for managing 404s, not CloudFront (which would handle them properly), as I think the author intends. When S3 manages the 404s, it does work (it directs to index.html), but the response code is still 404, which is obviously wrong (and will mess with SEO).
I'm just working on tweaking my setup to turn off static website hosting on the bucket, and changing the distribution to an S3 origin, which I believe should remedy the problem, and begin respecting the custom error page handling on CloudFront.
The 'create' command creates an S3 bucket configured with static website hosting and a cloudfront distribution with a custom origin (rather than origin of type 'S3').
The issue for Single Page Applications (SPAs) that require all routes to redirect to index.html is that the setup respects the S3 static website hosting rules for managing 404s, not CloudFront (which would handle them properly), as I think the author intends. When S3 manages the 404s, it does work (it directs to index.html), but the response code is still 404, which is obviously wrong (and will mess with SEO).
I'm just working on tweaking my setup to turn off static website hosting on the bucket, and changing the distribution to an S3 origin, which I believe should remedy the problem, and begin respecting the custom error page handling on CloudFront.