question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

S3 Static Website Hosting

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11 (9 by maintainers)

github_iconTop GitHub Comments

7reactions
john-shaskincommented, Dec 13, 2018

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.

const websiteBucket = new s3.Bucket(this, 'MyStaticWebsite', {
  websiteIndexDocument: 'index.html',
  websiteErrorDocument: 'error.html'
});
websiteBucket.grantPublicAccess('*', 's3:GetObject');
0reactions
iliapolocommented, Aug 29, 2020

Closing as we now have all the WebsiteConfiguration properties: https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-s3.Bucket.html

  • websiteErrorDocument
  • websiteIndexDocument
  • websiteRedirect
  • websiteRoutingRules
Read more comments on GitHub >

github_iconTop Results From Across the Web

Hosting a static website using Amazon S3
You can use Amazon S3 to host a static website. On a static website, individual webpages include static content. They might also contain...
Read more >
How to Host a Website on S3 Without Getting Lost in the Sea
Navigate to S3 in the AWS Console. · Click into your bucket. · Click the “Properties” section. · Click the “Static website hosting”...
Read more >
How to Host a Static Website on AWS S3 - Linux Hint
The first step to hosting a static website on AWS S3 is to create an S3 bucket in your account. After creating the...
Read more >
How to Host a Static Website in the Cloud With AWS S3
To host your static website in the cloud on S3, you need to upload your files and folders to the configured S3 bucket....
Read more >
Hosting a Static Website with Amazon S3 - DEV Community ‍ ‍
Hosting a Static Website with Amazon S3 · Step 1 — Create an S3 bucket · Step 2 — Upload web files to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found