阅读背景:

在将s3文件移动到cloudfront时,想要排除某些文件

来源:互联网 

I have files stored in s3, some files are accessed often, but other files are just stored for later use.

我有文件存储在s3中,一些文件经常被访问,但其他文件只是存储供以后使用。

We do not need to cdn these files at all.

我们根本不需要cdn这些文件。

Is there a way to tell cloudfront not to fetch these files from s3?

有没有办法告诉cloudfront不要从s3获取这些文件?

1 个解决方案

#1


1  

Easiest way is to move them to a separate s3 bucket however another option is to keep the objects you don't want exposed as private.

最简单的方法是将它们移动到一个单独的s3桶中,但另一个选择是将不希望暴露的对象保持为私有。

By default, your Amazon S3 bucket and all of the objects in it are private—only the AWS account that created the bucket has permission to read or write the objects in it. If you want to allow anyone to access the objects in your Amazon S3 bucket using CloudFront URLs, you must grant public read permissions to the objects. (This is one of the most common mistakes when working with CloudFront and Amazon S3. You must explicitly grant privileges to each object in an Amazon S3 bucket.)

默认情况下,您的Amazon S3存储桶及其中的所有对象都是私有的 - 只有创建存储桶的AWS账户才有权读取或写入其中的对象。如果要允许任何人使用CloudFront URL访问Amazon S3存储桶中的对象,则必须为对象授予公共读取权限。 (这是使用CloudFront和Amazon S3时最常见的错误之一。您必须明确授予Amazon S3存储桶中每个对象的权限。)

Source: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/GettingStarted.html#GettingStartedUploadContent

资料来源:http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/GettingStarted.html#GettingStartedUploadContent

Hopefully that answers your question.

希望能回答你的问题。


分享到: