AWS/S3 – Static Web Site – Troubleshooting – Day 01

Background

Wanted to talk a bit about errors one can encounter trying to configure static websites via AWS/S3.

Errors

Error List

  1. 404 – Not Found
    • Code: NoSuchWebsiteConfiguration
  2. 403 – Forbidden
    • Access Denied

 

Error.404

NoSuchWebSiteConfiguration

Image

Textual

404 Not Found
Code: NoSuchWebsiteConfiguration
Message: The specified bucket does not have a website configuration
BucketName: cloudacademylabswebsitestaticexamplebyda
RequestId: 996E0FC2478E245E
HostId: hK067xGc9U4xpKKudGtTzM9Ww2ug77WB5Yo8ysThNRECOnij74dNwwQc5cAgqXx3RW/tIziutdE=

Explanation

  1. Connotes that bucket has not been configured for static web site hosting
  2. To re-mediate please do the following
    • Access S3 Bucket
    • Access S3 Bucket Property
    • Change from current option of “Disable web hosting” to “Use this bucket to host a website

 

Remedy

Current

Revise

 

Error.403 – Forbidden

Access Denied

Image

Textual

403 Forbidden
Code: AccessDenied
Message: Access Denied
RequestId: AF38AC49C1396730
HostId: zRoAu4cGBlB6ANftEHbDqKHgAKcOpmr4DEHwi2ORYECMQFRobpdjk3pjMXxMXHyZ3f/75UHZxoc=
An Error Occurred While Attempting to Retrieve a Custom Error Document
Code: AccessDenied
Message: Access Denied

Explanation

  1. States that Access is denied
  2. To re-mediate please do the following
    • Access S3 Bucket
    • Access S3 Bucket Property
    • Permissions
      • Block Public Access
        • Ensure that “Block Public Access” is not enforced
      • Access Control List ( ACL )
        • Principals
          • Allow access to everyone
          • Or access to specific Canonical IDs
        • Permission Set
          • List Objects
          • Read Object Permission
      • Bucket Policy
        • Design and enter Bucket Policy

Images

Block Public Access

Access Control List ( ACL )

Bucket Policy

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

 

Summary

More later as we develop our own static web sites and intentionally break things.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s