0
votes

I created an S3 bucket, and set it up as a Static Website as instructed in http://docs.aws.amazon.com/AmazonS3/latest/dev/website-hosting-custom-domain-walkthrough.html

Afterwards, the basic domain is returning a AccessDenied: http://www.mydomain.com.s3-us-west-1.amazonaws.com/

However, my index page serves just fine: http://www.mydomain.com.s3-us-west-1.amazonaws.com/index.html

So it isn't related to the permissions of the files in the bucket (those are public now)

I get the feeling that I am missing a piece that links http://www.mydomain.com.s3-us-west-1.amazonaws.com/ to http://www.mydomain.com.s3-us-west-1.amazonaws.com/index.html, yet the docs read as though the "Static Web Hosting" property should do it all as long as you specify the index.html and error.html.

My bucket policy is standard:

{
    "Version": "2012-10-17",
    "Id": "PublicBucketPolicy",
    "Statement": [
        {
            "Sid": "Stmt1482880670019",
            "Effect": "Allow",
            "Principal": "*",
            "Action": "s3:GetObject",
            "Resource": "arn:aws:s3:::www.mydomain.com/*"
        }
    ]  
}

Note: I didn't do the route 53 setup, because I want to direct my websites DNS CNAME to www.mydomain.com.s3-us-west-1.amazonaws.com once I see it working.

1

1 Answers

4
votes

Your endpoint is wrong: www.mydomain.com.s3-eu-west-1.amazonaws.com

It looks like you configured your bucket in eu-west-1, but you are referencing us-west-1.

However, you are not using the correct URL for S3 web site. The URL must have "s3-website-" in the name like this example:

www.mydomain.com.s3-website-eu-west-1.amazonaws.com

Start over with this document and double check each step:

Setting up a Static Website Using a Custom Domain