EMAIL SUPPORT

dclessons@dclessons.com

LOCATION

NZ

LAB Setting up a Static Website

LAB Setting up a Static Website

Posted on Jan 17, 2020 (0)

LAB Setting up a Static Website

You can configure an Amazon S3 bucket to function like a website. This example walks you through the steps of hosting a website on Amazon S3.

Task

  • Create a Bucket and configure It as a website
  • Add a Bucket Policy which will make your Bucket content publicly available
  • Upload an Index document
  • Testing Your website

Creating a Bucket and Configuring It as a Website

Create the Bucket dclessons1 as described in previous LAB section.

Open the bucket Properties pane and choose Static Website Hosting, and configure the following:

  • Choose Enable website hosting option.
  • In the Index Document box, mention the name of your index document. The name is typically index.html.
  • Choose Save in order to save the website configuration.
  • Write down the Endpoint which is URL and this  endpoint address be used to access the bucket from outside.

This is the Amazon S3-provided website endpoint for your bucket. You use this endpoint in the following steps to test your website.


Adding a Bucket Policy That Makes Your Bucket Content Publicly Available

  • In the Properties pane for the bucket, choose Permissions option.
  • Choose Add Bucket Policy option.
  • Copy the following bucket policy, and then paste it in the Bucket Policy Editor.
  • Choose Save.

{
"Version":"2012-10-17",
"Statement":[{
"Sid":"Public ReadForGetBucketObjects",
"Effect":"Allow",
"Principal": "*",
"Action":["s3:GetObject"],
"Resource":["arn:aws:s3:::dclessons1/*"
]
}
]
}

Uploading an Index Document

  • Create a document ( text file : put some details and save it as index.html.) Give it the same name that you have given to the index document earlier in above section.
  • Using the console, upload the index document to your bucket properly.

Testing Your Website

Type the following URL in the browser, use this format : http://example-bucket.s3-website-region.amazonaws.com

Here the URL will be : http://dclessons1.s3-website-us-west-2.amazonaws.com/


Comment

    You are will be the first.

LEAVE A COMMENT

Please login here to comment.