InvalidLocationConstraint error while creating S3 bucket when the used command is

11,632

Solution 1

Used this command. Remove the location constraint and it worked

aws s3api create-bucket --bucket mytest-bucket

Solution 2

If your region is us-east-1 then you simply run the command without the --location constraint because by default bucket is created in the us-east-1 region

Solution 3

try this u will get now aws s3 mb s3://bucket-name --region us-east-1

Share:
11,632
coder
Author by

coder

Updated on June 29, 2022

Comments

  • coder
    coder almost 2 years

    An error occurred (InvalidLocationConstraint) when calling the CreateBucket operation: The specified location-constraint is not valid when using the command

    aws s3api create-bucket --bucket my-bucket
    --create-bucket-configuration LocationConstraint=region
    
    • John Rotenstein
      John Rotenstein over 5 years
      Please edit your question to include the command you used.
    • jarmod
      jarmod over 5 years
      Please include a question in your statement ;-)
  • CryptoFool
    CryptoFool over 2 years
    Does this choice of behavior make any sense to anyone? Why should it matter if your constraint happens to be the default case? Even if there's a reason for this, AWS should fix it in the client code to make this a non issue. This behavior...needing to special case your code for one particular region...makes absolutely no sense.
  • SimonW
    SimonW almost 2 years
    It sure does not, this is frustrating wasting time on this