aws s3api create-bucket —bucket make exception

前端 未结 5 853
暖寄归人
暖寄归人 2021-02-12 22:13

I am trying to create an S3 bucket using

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

It gives this error:



        
5条回答
  •  终归单人心
    2021-02-12 22:45

    I have seen many answers like the first one about "LocationConstraint". The answer is correct, but only covers half the case. I tried to include "LocationConstraint" to solve the problem but still got the same error. It's Omar Zairi's second answer gave me a clue.

    The message here is in fact very confusing. When you are trying to create a bucket with a name that's already taken, only when your configured region is the same as the bucket with the already taken name's region, you receive the message "The requested bucket name is not available". Otherwise, you receive "location constraint is incompatible for the region specific endpoint this request was sent to".

    To find if a name is already taken, and in case it's taken, which region the bucket with that name is in, look at the DNS record of "the-name.s3.amazonaws.com".

    Below I use a taken name "test8765" to show what I mentioned above. Hope this helps whoever got confused like I did.

    bing@bingstp:~$ dig test8765.s3.amazonaws.com
    
    ; <<>> DiG 9.11.3-1ubuntu1.3-Ubuntu <<>> test8765.s3.amazonaws.com
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 39766
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1
    
    ;; OPT PSEUDOSECTION:
    ; EDNS: version: 0, flags:; udp: 65494
    ;; QUESTION SECTION:
    ;test8765.s3.amazonaws.com. IN  A
    
    ;; ANSWER SECTION:
    test8765.s3.amazonaws.com. 2016 IN  CNAME   s3-us-west-2-w.amazonaws.com.
    s3-us-west-2-w.amazonaws.com. 5 IN  A   52.218.216.10
    
    ;; Query time: 16 msec
    ;; SERVER: 127.0.0.53#53(127.0.0.53)
    ;; WHEN: Thu Jan 03 15:16:11 AEDT 2019
    ;; MSG SIZE  rcvd: 99
    
    bing@bingstp:~$ aws s3api create-bucket --bucket test8765
    
    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.
    bing@bingstp:~$ aws s3api create-bucket --bucket test8765 --create-bucket-configuration LocationConstraint=eu-west-1
    
    An error occurred (IllegalLocationConstraintException) when calling the CreateBucket operation: The eu-west-1 location constraint is incompatible for the region specific endpoint this request was sent to.
    bing@bingstp:~$ aws s3api create-bucket --bucket test8765 --create-bucket-configuration LocationConstraint=us-west-2
    
    An error occurred (BucketAlreadyExists) when calling the CreateBucket operation: The requested bucket name is not available. The bucket namespace is shared by all users of the system. Please select a different name and try again.
    bing@bingstp:~$ aws s3api create-bucket --bucket test8765 --create-bucket-configuration LocationConstraint=us-west-1
    
    An error occurred (IllegalLocationConstraintException) when calling the CreateBucket operation: The us-west-1 location constraint is incompatible for the region specific endpoint this request was sent to.
    bing@bingstp:~$ 
    

提交回复
热议问题