S3 Website Overview Hands On

Okay, so let’s enable our bucket to be a website.

πŸ“ Step 1: Upload an Additional File

  • First, upload one more file to the bucket: β†’ beach.jpg
    Here is the image for you to download:
workshop scene
  • Upload is successful.
    β†’ Now we have two files in the bucket.
workshop scene

βš™οΈ Step 2: Enable Static Website Hosting

  • Go to the Properties tab.
workshop scene
  • Scroll all the way down to find Static website hosting.
workshop scene
  • Click on Edit.

In the configuration:

  • Select: Enable static website hosting
  • Choose: Host a static website
workshop scene
  • Specify the Index document:
    β†’ index.html

πŸ“Œ This file will be the default/homepage of the website.

  • A warning will appear:
    β†’ If you want to enable this as a website endpoint, you must make all your content publicly readable. (V.V.IMP)

  • Since we already did this in the previous lecture using a public bucket policy, we’re good.

  • Click Save.

πŸ“€ Step 3: Upload the Index File

  • Go back into the Objects tab.

  • You’ll notice the index.html file is still missing.

  • Click Upload

    • Add file: index.html (I presummed that you would be having your dummy coded index.html file)
    • Click Upload, then Close
  • Now index.html is uploaded.


πŸ”— Step 4: Access Website via Endpoint

  • Go back to Properties tab.
  • Scroll down again to Static website hosting.
  • Now you will see a Bucket website endpoint.
  • Copy the URL and paste it in your browser.
workshop scene

βœ… The page shows: β€œI love coffee. Hello world!” And displays coffee.jpg.

workshop scene

πŸ“Έ Step 5: Test Public URLs for Images

  • Right click on coffee.jpg and open it in a new tab. β†’ You can access the public URL.

  • Similarly, edit the url in the browser engine, and change coffee.jpg to beach.jpg

workshop scene

β†’ You can also see the beach image in a new tab.