Search code examples
amazon-web-servicesamazon-s3aws-sdk

InvalidLocationConstraint error while creating S3 bucket when the used command is


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

Solution

  • Used this command. Remove the location constraint and it worked

    aws s3api create-bucket --bucket mytest-bucket