On my macOS Sierra:
$ aws s3api create-bucket --bucket testbucket --region us-west-1
{
"Location": "/testbucket"
}
Then...
$ aws s3api get-bucket-location --bucket testbucket
{
"LocationConstraint": null
}
The weird thing is if I were to check my console, it would show my bucket created but in US East(N. Virginia region). Is the us-west-1 region not available or something?
If it makes a difference, from
$ aws configure
I can see that my default region name is us-west-1
Default region name [us-west-1]:
From the documentation: "Regions outside of us-east-1 require the appropriate LocationConstraint to be specified in order to create the bucket in the desired region"
Try:
aws s3api create-bucket --region us-west-1 --bucket textbucket --create-bucket-configuration LocationConstraint=us-west-1