Create S3 Bucket and Upload Website Data to the Bucket

In this step, we will create an S3 bucket and upload the website data we wrote in step 2.5 to the bucket for website hosting.

  1. Access the S3 service, find the Buckets section, and select Create bucket.

Create S3 Step 1

  1. In the Create Bucket interface, name your bucket as desired, but the bucket name must be unique within your region, then click Create bucket.

Create S3 Step 2

  1. Access the bucket you just created, and select Upload.

Create S3 Step 3

In the Upload interface, click Add files.

Create S3 Step 4

Upload the two web resource files that you created in step 2.5.

Create S3 Step 5

  1. In the same bucket, switch to the Properties tab, scroll down to find Static website hosting, and click Edit.

Create S3 Step 6

  1. In the Edit interface, under Static website hosting, select Enable. For Index Document, enter index.html, and finally click Save.

Create S3 Step 7

  1. Switch to the Permissions tab, find the Bucket policy section, and select Edit.

Create S3 Step 8

Select Policy generator.

Create S3 Step 9

In the Select Type of Policy section, choose S3 Bucket Policy, set Effect to Allow, enter * for Principal as shown in the image, and for Actions, select GetObject() from the list. For ARN, enter the ARN of the bucket you created, then click Add Statement, and finally scroll down and click Generate Policy.

Create S3 Step 10

  1. After clicking Generate Policy, you will receive a Policy JSON Document. Edit the line I highlighted by adding /* as shown in the image (the code after adding it), and then copy the policy.

Create S3 Step 11

  1. Return to the Edit interface of the Bucket Policy, paste the copied policy into the box, and click Save Changes.

Create S3 Step 12