Cloud Front Access Denied while try to access application (.gz files)

0

I saved my application files in.gz format in a subfolder of my S3 bucket, however when I tried to access them from cloud front, I received an Access Denied error.

Bucket Policy has already been added.

{ "Version": "2008-10-17", "Id": "PolicyForCloudFrontPrivateContent", "Statement": [ { "Sid": "AllowCloudFrontServicePrincipal", "Effect": "Allow", "Principal": { "Service": "cloudfront.amazonaws.com" }, "Action": "s3:GetObject", "Resource": "arn:aws:s3:::<<S3 Bucket>>/*", "Condition": { "StringEquals": { "AWS:SourceArn": "arn:aws:cloudfront::56723652868056:distribution/<<Distribution ID>>" } } } ] }

I've already included origin and behaviour in my distribution.

已提问 9 个月前210 查看次数
1 回答
0

Can you make sure that S3 bucket is not SSE-KMS CMK encrypted.

Did you take a look at this blog post. This explains step by step process for how to "Enable SSE-KMS for CloudFront OAC".

Refer Enable SSE-KMS for CloudFront OAC section in above mentioned blog post, which explains how to update the KMS key policy for cloudfront distribution.

Check S3 bucket properties to find which KMS key is being used.

  1. Make sure you update the KMS key policy used in S3 encryption to allow the CloudFront service principal arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity to call kms:Decrypt on the key.
  2. KMS Key and S3 bucket are in same region

Hope this helps.

Comment here if you have additional questions, happy to help.

Abhishek

profile pictureAWS
专家
已回答 9 个月前
profile picture
专家
已审核 9 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则