Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 

Repository files navigation

Create a static website and host it on s3 bucket but with public read policy assigned, using cloudfront for CDN.

My Solution

1. Create an AWS account

2. Search for s3 and choose "Create bucket" to create s3 bucket.

alt text

3. Give bucket a unique name, leave every other settings as default and upload.

4. Upload objects (static website files) to the bucket created above

alt text

5. Search for cloudfront

alt text

6. Then create a distribution

alt text

7. Setup the distribution as follows:

  • Set the origin domain to the s3 bucket to be deployed alt text

  • The Origin access is set to Public by default but we'll be changing it to Origin access control settings (recommended)

  • Then select the s3 bucket we intend to deloy alt text

  • Enable security protections alt text

  • Set default root object to the landing page and create distribution alt text

8. Copy the policy by clicking the "Copy policy" button

alt text

9. Go to the permission of the s3 bucket

alt text

10. Edit the bucket policy

alt text

11. Paste the policy and click on "save changes"

alt text

12. Go back to the cloudfront distribution and copy the domain name generated.

alt text

Static website hosted succesffully alt text

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors