Starboy
Starboy

Reputation: 1635

Custom URL to AWS Cloudfront URL returns 403

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/*"
        }
    ]
}

Upvotes: 0

Views: 676

Answers (1)

Starboy
Starboy

Reputation: 1635

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

Upvotes: 1

Related Questions