Search code examples
amazon-web-servicesamazon-cloudfront

AWS - Cloudfront / S3 - Access Denied


enter image description here

My website is on AWS EC2 instance. It has Cloudfront & S3 bucket.

When I am trying to access my website. I am keep getting Access Denied error.

I am not sure what configuration I am missing.

Below is my bucket policy.

{
    "Version": "2008-10-17",
    "Id": "PolicyForCloudFrontPrivateContent",
    "Statement": [
        {
            "Sid": "MakePublic",
            "Effect": "Allow",
            "Principal": "*",
            "Action": "s3:*",
            "Resource": "arn:aws:s3:::domain-cdn/*"
        }
    ]
}

Already followed https://aws.amazon.com/premiumsupport/knowledge-center/cloudfront-access-to-amazon-s3/

I am using Cloudfront & it is point to S3 bucket.


Solution

  • enter image description here

    So from the server it is always looking for index.html file & giving 403 error.

    By setting up below it resolved. Thanks