0
0
AWScloud~10 mins

Static website hosting on S3 in AWS - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create an S3 bucket for static website hosting.

AWS
aws s3api create-bucket --bucket [1] --region us-east-1
Drag options to blanks, or click blank then click option'
Awebsite-bucket
Bmy-static-site-bucket-123
Cstatic-website
Dmy-static-site-bucket
Attempts:
3 left
💡 Hint
Common Mistakes
Using a bucket name that is already taken by someone else.
Using uppercase letters or spaces in the bucket name.
2fill in blank
medium

Complete the code to enable static website hosting on the S3 bucket.

AWS
aws s3 website s3://[1]/ --index-document index.html
Drag options to blanks, or click blank then click option'
Amy-static-site
Bwebsite-bucket
Cstatic-website
Dmy-static-site-bucket-123
Attempts:
3 left
💡 Hint
Common Mistakes
Using a different bucket name than the one created.
Forgetting to add the 's3://' prefix.
3fill in blank
hard

Fix the error in the bucket policy to allow public read access for website files.

AWS
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "PublicReadGetObject",
      "Effect": "Allow",
      "Principal": [1],
      "Action": "s3:GetObject",
      "Resource": "arn:aws:s3:::my-static-site-bucket-123/*"
    }
  ]
}
Drag options to blanks, or click blank then click option'
A"*"
B"arn:aws:iam::123456789012:user/Alice"
C"aws:PrincipalOrgID"
D"s3:PublicAccessBlock"
Attempts:
3 left
💡 Hint
Common Mistakes
Setting Principal to a specific user instead of everyone.
Using invalid Principal values.
4fill in blank
hard

Fill both blanks to configure the bucket policy to allow public read access only to website files.

AWS
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": [1],
      "Action": [2],
      "Resource": "arn:aws:s3:::my-static-site-bucket-123/*"
    }
  ]
}
Drag options to blanks, or click blank then click option'
A"*"
B"s3:GetObject"
C"s3:PutObject"
D"arn:aws:iam::123456789012:user/Alice"
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong actions like "s3:PutObject" which allows uploads.
Setting Principal to a specific user instead of everyone.
5fill in blank
hard

Fill all three blanks to sync local website files to the S3 bucket and make them publicly readable.

AWS
aws s3 sync [1] s3://[2] --acl [3]
Drag options to blanks, or click blank then click option'
A./website
Bmy-static-site-bucket-123
Cpublic-read
Dprivate
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'private' ACL which blocks public access.
Using wrong local folder path.
Using wrong bucket name.