2016-11-08 32 views
0

不知道为什么发生这种情况,但得到空的位置呼叫s3api得到桶定位为美国东1返回null斗

aws --version 
aws-cli/1.10.62 Python/2.7.11 Darwin/16.1.0 botocore/1.4.52 
aws> s3api get-bucket-location --bucket joshuacalloway-us-east-2-bucket 
{ 
    "LocationConstraint": "us-east-2" 
} 
aws> s3api get-bucket-location --bucket joshuacalloway-us-east-1-bucket 
{ 
    "LocationConstraint": null 
} 

回答

2

美国东部-1是一个特定区域,作为讨论在一些AWS DOC如下:

https://aws.amazon.com/fr/blogs/developer/leveraging-the-s3-and-s3api-commands/

例如,如果我让使用S3命令位于法兰克福区域铲斗:

$ aws s3 mb s3://myeucentral1bucket --region eu-central-1 
make_bucket: s3://myeucentral1bucket/` 

然后我可以使用s3api得到-斗位置,以确定为我的新桶的区域:

$ aws s3api get-bucket-location --bucket myeucentral1bucket 
{ 
    "LocationConstraint": "eu-central-1" 
} 

如上所示,在输出的LocationConstraint成员的值JSON是预期区域的斗,eu-central-1请注意,对于在美国标准区域us-east-1中创建的存储桶,LocationConstraint的值将为空。作为位置约束如何与区域对应的快速参考,请参阅AWS区域和终端指南。

http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region

如果使用非美国东(N.弗吉尼亚州)端点之外的区域创建一斗,你必须在LocationConstraint桶参数设置为相同的区域

相关问题