Ask Your Question
3

How can AWS S3 Bucket policy be utilized to enable IAM user access to Cloudfront?

asked 2022-11-19 11:00:00 +0000

plato gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2021-10-10 08:00:00 +0000

bukephalos gravatar image

To enable IAM user access to CloudFront using AWS S3 bucket policy, follow the steps below:

  1. Open the AWS S3 console and select the bucket that contains the objects you want to distribute through CloudFront.

  2. On the bucket’s properties page, select “Permissions.”

  3. Under “Bucket Policy,” click on “Edit.”

  4. To grant CloudFront permission, add the following JSON to the bucket policy document:

{ "Version":"2012-10-17", "Statement":[ { "Effect":"Allow", "Principal":{ "AWS":[ "arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity ABC123" ] }, "Action":"s3:GetObject", "Resource":"arn:aws:s3:::bucket-name/*" } ] }

Note that in the above JSON, replace “bucket-name” with your actual bucket name and “ABC123” with your actual CloudFront origin access identity.

  1. Click on “Save Changes.”

  2. Make sure that the IAM user accessing CloudFront has permission to access the S3 bucket.

  3. Create a CloudFront distribution with the S3 bucket as the origin.

  4. Test the access to the CloudFront URL.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-11-19 11:00:00 +0000

Seen: 10 times

Last updated: Oct 10 '21