2016-11-08 31 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桶參數設置爲相同的區域

相關問題