AWS S3 Error – InvalidLocationConstraint – “The specified location-constraint is not valid”

This error is returned when trying to create a S3 bucket using the location parameter and the value passed is not valid.
<?xml version="1.0" encoding="UTF-8"?>
<Message>The specified location-constraint is not valid</Message>
The valid list of locations as documented here is below:
Valid Values:
  • us-west-1
  • us-west-2
  • EU or eu-west-1
  • eu-central-1
  • ap-south-1
  • ap-southeast-1
  • ap-southeast-2
  • ap-northeast-1
  • ap-northeast-2
  • sa-east-1
  • empty string (for the US East (N. Virginia) region)
  • us-east-2