2
votes

I'm trying to allow AWS Route 53 to manage a domain I bought on Name.com so I can apply the domain to an AWS bucket that is hosting a static website.

I've attempted to follow the outlined instructions from this post which I'm guessing is out of date (Domain name setup with AWS S3 bucket with static hosting)

  1. Create the hosted zone with your domain name, domain.com

  2. Create an A record for your domain. On the right side you'll see a radio button "Alias" choose yes, then click into the target box and wait for your bucket to appear under S3 Website endpoints. (More on this below).

  3. Select your bucket and click create.

  4. Head over to your registrar, NameCheap and configure the nameservers to use the AWS nameservers in the NS record from your AWS hosted zone.

  5. Your bucket name must match the domain name.

  6. In the properties tab, you need to enable the static website hosting option and provide your index page.

  7. In the permissions tab, click on bucket policy, then click the policy generator link at the bottom.

  8. In the policy generator, select S3 as the type of policy

  9. Set the principal to *

  10. Set the action to Get Object set the ARN to the ARN for your bucket /*. For example arn:aws:s3:::domain.com/*

  11. Click Add statement, then generate policy and paste that into the bucket policy and save.

But I'm having an issue with last point 7. Applying the generated policy to the bucket policy, it is throwing the following error:

Action does not apply to any resource(s) in statement

1

1 Answers

0
votes

We would suggest try below policy for your bucket which is provided by AWS

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

Replace example-bucket with your bucket name
Navigate through below link How Do I Configure an S3 Bucket for Static Website Hosting?