简体   繁体   English

我应该将Amazon S3存储桶放在哪个区域?

[英]in which region should I put my amazon s3 bucket?

I have a heroku app running from region europe 我有一个来自europe地区的heroku应用程序

I can't upload an image in a form in my rails app (RoR 6) due to a same origin policy at my amazon s3 bucket. 由于我的Amazon S3存储桶采用了same origin政策,因此无法在Rails应用程序(RoR 6)中以表格形式上传图片。 That bucket is in eu-west-1 (Dublin - where I thought heroku also is) 那个水桶在eu-west-1 (都柏林-我以为heroku也在这里)

Should I have put the bucket in France eu-west-3 since my domain is French? 由于我的域名是法语,我应该在法国eu-west-3放水桶吗?

This is my CORS file: 这是我的CORS文件:

<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
    <AllowedOrigin>https://www.cremers.fr/adm/auteur/2/article/nouveau</AllowedOrigin>
    <AllowedOrigin>https://www.cremers.fr/</AllowedOrigin>
    <AllowedMethod>GET</AllowedMethod>
    <AllowedMethod>POST</AllowedMethod>
    <AllowedMethod>PUT</AllowedMethod>
    <MaxAgeSeconds>3000</MaxAgeSeconds>
    <AllowedHeader>*</AllowedHeader>
</CORSRule>
</CORSConfiguration>

You can use any region. 您可以使用任何区域。

It has nothing to do with the domain. 它与域无关。

You can at least us-east-2 or us-west-1 . 您至少可以使用us-east-2us-west-1 It doesn't matter. 没关系

The only thing that may affect this is the download speed. 可能会影响此的唯一因素是下载速度。 If user is in France, then it will be a little longer to download from the Canadian server than from the European one. 如果用户在法国,那么从加拿大服务器下载的时间要比从欧洲服务器下载的时间长一点。

But this can be neglected. 但这可以忽略。

As per AWS 根据AWS

An Amazon S3 bucket name is globally unique, and the namespace is shared by all AWS accounts. Amazon S3存储桶名称在全球范围内是唯一的,名称空间由所有AWS账户共享。 This means that after a bucket is created, the name of that bucket cannot be used by another AWS account in any AWS Region until the bucket is deleted. 这意味着创建存储桶之后,该存储桶的名称将无法被任何AWS区域中的另一个AWS账户使用,直到删除该存储桶为止。 You should not depend on specific bucket naming conventions for availability or security verification purposes. 您不应出于可用性或安全性验证的目的而依赖特定的存储桶命名约定。

Amazon S3 creates buckets in a Region you specify. Amazon S3在您指定的区域中创建存储桶。 To optimize latency, minimize costs, or address regulatory requirements, choose any AWS Region that is geographically close to you. 为了优化延迟,最大程度地降低成本或满足法规要求,请选择地理位置最接近您的任何AWS区域。 For example, if you reside in Europe, you might find it advantageous to create buckets in the EU (Ireland) or EU (Frankfurt) Regions. 例如,如果您居住在欧洲,则可能会发现在欧盟(爱尔兰)或欧盟(法兰克福)地区创建存储桶是有利的。 For a list of Amazon S3 Regions, see Regions and Endpoints in the AWS General Reference. 有关Amazon S3区域的列表,请参阅AWS General Reference中的区域和端点。

So it depends on your application usage and region to choose S3 bucket region 因此,选择S3存储桶区域取决于您的应用程序使用情况和区域

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM