-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
S3 Static Website Hosting #632
Comments
Yes, it's a known missing feature. Currently, the only way to work around these types of gaps is to override the See #606 for an example on how to implement something like this and a discussion on possible approaches we are considering. |
@eladb we now have https://awslabs.github.io/aws-cdk/refs/_aws-cdk_aws-s3-deployment.html , so that's great start. Is there already a way to configure S3 Bucket/CloudFront distribution to host those files, or is that still going down to L1 level? |
There is a cloud front L2 which I believe needs quite a lot of work. Also, we need to add support for blue/green deployments of static content as part of s3-deployment |
Hey, @Jumblemuddle, are you just looking to set up an s3 bucket as a static website, or something more involved? I've currently been able to set up a publicly readable s3 site with the following snippet.
|
Still relevant |
I have an S3 Website Hosting construct in my library. Maybe this could be integrated: https://github.com/taimos/cdk-constructs/blob/master/lib/web/single-page-app.ts What do you think? |
@hoegertn Fancy seeing you here. You've linked me on the AWS Community Day to your stack. The only "problem" I have with it is that it tends to redirect me to /index.html in almost all error cases. Since I am using a Vue SPA, the router picks it up and simply shows a blank page. Redirecting to "/" so the browser can fetch the index.html on its own would be better (haven't figured out how to configure the CDK code for that yet though). Otherwise it works as expected, having a blue green deployment would be amazing 👍 |
It is not redirecting but returning the content of |
Hmm, when I enter |
Yes, Cloudfront is configured with DefaultPage of |
Closing as we now have all the
|
Currently an S3 bucket can't be configured with a
WebsiteConfiguration
.Is there any sort of escape hatch to do this or would I need to create some sort of custom resource?
I know I could create CloudFront distribution, but I'm not looking to do that at the moment.
The text was updated successfully, but these errors were encountered: