getmoto / moto

A library that allows you to easily mock out tests based on AWS infrastructure.

Home Page:http://docs.getmoto.org/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

S3: LocationConstraints should be validated

bblommers opened this issue · comments

Two scenario's:

  • (How) Does AWS complain if the region is incorrect in the same partition?
  • (How) does AWS complain if the region is incorrect in a different partition?
s3_resource = boto3.resource("s3", region_name="us-east-2")
s3_resource.create_bucket(Bucket="foobar", CreateBucketConfiguration={"LocationConstraint": "eu-central-1"})
s3_resource = boto3.resource("s3", region_name="us-east-2")
s3_resource.create_bucket(Bucket="foobar", CreateBucketConfiguration={"LocationConstraint": "us-gov-east-2"})