aws s3api create-bucket -bucket make exception

wth*_*ira 9 amazon-s3 amazon-web-services kubernetes kops

我尝试使用创建s3桶

aws s3api create-bucket —bucket kubernetes-aws-wthamira-io

它会犯这个错误

调用CreateBucket操作时发生错误(IllegalLocationConstraintException):未指定的位置约束与此请求发送到的区域特定端点不兼容.

我使用aws configure区域设置并将区域设置为eu-west-1

An error occurred (IllegalLocationConstraintException) when calling
the CreateBucket operation: The unspecified location constraint is
incompatible for the region specific endpoint this request was sent
to.
Run Code Online (Sandbox Code Playgroud)

但是犯同样的错误.我怎么解决这个问题.

我使用osx终端连接aws

Asd*_*dfg 21

试试这个:

aws s3api create-bucket --bucket kubernetes-aws-wthamira-io --create-bucket-configuration LocationConstraint=eu-west-1
Run Code Online (Sandbox Code Playgroud)

外部区域us-east-1需要LocationConstraint指定适当的区域,以便在期望的区域中创建桶.

https://docs.aws.amazon.com/cli/latest/reference/s3api/create-bucket.html

  • 为了完整起见,该示例应包含 --region 选项:该命令将需要 --region 选项和 --create-bucket-configuration 选项(冗余地)指定区域,例如 `aws s3api create-bucket - -bucket kubernetes-aws-wthamira-io --region eu-west-1 --create-bucket-configuration LocationConstraint=eu-west-1` (3认同)

Oma*_*iri 9

如果您尝试创建名称已被占用的存储桶,您也会收到此错误。

因此,尝试为您的存储桶指定一个更独特的名称,然后它应该可以工作(我只是在存储桶名称的末尾添加了数字)。


Nit*_*hya 8

使用 mb 为我们解决了这个问题

aws s3 mb s3://storage.example.com --region us-west-1