Lab Exercise 6: Hosting a Static Webpage in Amazon S3

 

For hosting a static website in Amazon S3, you'll need the following:

  • AWS Account
  • Static Webpage with HTML file for both index and 404

Procedure:
1. Open your AWS account and select S3 under Services.




2. Select 'Create Bucket' and Give Bucket name. Also uncheck the boxes to make sure that the bucket is publicly accessible. 





3. Finally select 'Create Bucket' to create our bucket.




4. Click our bucket and under objects tab, we have to upload our static webpage files. Select Upload and we can Add our files or folders.





5. The select the Property tab of the bucket. And Scroll down to Static Website Hosting feature and Enable it.





6. Then under Permissions tab. Edit the Bucket Policy by the following JSON statement:

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




7. Then select your HTML file and copy the URL. Then Paste the URL in the browser to see our website hosted.





Thus our Static webpage has been hosted.



Comments

Popular posts from this blog

Lab Exercise 8: Create and Carryout Read and Write Operation in AWS Dynamo DB​