0
votes

I'm receiving a 403 when I point my custom domain name 'example.com' to my CloudFront url 'xxx.cloudfront.net'.

If I go to the CloudFront URL directly everything works as expected, but when I try to access it through 'example.com' (which points to the same CloudFront url) I get the 403.

Am I missing some type of permissions setup in CloudFront somewhere?

Cloudfront is pulling from an S3 bucket with Static hosting enabled with the following bucket policy:

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

1 Answers

1
votes

The answer to this was to provide the CNAME (Alternate Domain Names (CNAMEs)) in Cloudfront. Which solved the issue.