Blog Details

+1
2
+1
1
+1
0
+1
0
+1
0

Hosting static website in S3 Bucket with iCTPro

Why you want a static website?

Think about the possibilities, 
  • Documentation
  • A Resume Website
  • Status page
  • Forms
  • A maintenance window page .. etc.

Why AWS S3 ?

Security is highly prioritized in all AWS services.Also, there are different options to encrypt your data at rest with unlimited storage. Check this link if you want to learn more about AWS S3 Bucket.

Prerequisite for this tutorial

  • AWS account 
  • Web Content that you need to upload – Try Mobirise a straightforward drag and drop website builder. Its free, Build your Resume now…
  • Admin Access to S3 Bucket
  • A S3 bucket you have created. – if you don’t have one check this link, it will guide you to create a step by step tutorial to create a S3 bucket. 
  • Login to your AWS account and Navigate to S3. 
  • Select your bucket  

we will be selecting this bucket that is already created , in case you do not know how to create one check out this link . Click on your bucket name

3. Click on to upload and add your files by clicking Add Folder or Add files.

4. Now let’s upload the web content and scroll down click upload your files

5.  Now go back to your  bucket and click Properties scroll down to Static website hosting. Click edit.

6. Now Click enable Static website hosting. and make sure your index.html path is correct and Click on to Save changes

 

7. Now let’s set permissions, first we need to enable public access. For that, we need to go to the permissions  Click o to edit under Block public access .

8. Now lets et a bucket policy, Click on to Permissions, and then Bucket Policy the Click edit. Copy this Bucket policy that grants read-write access for the website. Make sure you replace Bucket arn -s3static-ictpro with your Bucket arn 

Now Click Save Changes and confirm. 

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

9. Now Navigate to your Bucket and Click on to properties Scroll down.

In the end you can see a endpoint which is your website url

http://s3static-ictpro.s3-website-ap-southeast-2.amazonaws.com 

Hurray Congratulation , you have successfully created a Static webpage in AWS with S3

Share Now !

[newsletter_form]