diff --git a/moto/dynamodb/urls.py b/moto/dynamodb/urls.py index 1132b7815..85634ef2f 100644 --- a/moto/dynamodb/urls.py +++ b/moto/dynamodb/urls.py @@ -1,7 +1,7 @@ from .responses import handler url_bases = [ - "https?://dynamodb.us-east-1.amazonaws.com", + "https?://dynamodb.(.+).amazonaws.com", "https?://sts.amazonaws.com", ] diff --git a/moto/ec2/urls.py b/moto/ec2/urls.py index e4f05aea7..65413369d 100644 --- a/moto/ec2/urls.py +++ b/moto/ec2/urls.py @@ -2,7 +2,7 @@ from .responses import EC2Response url_bases = [ - "https?://ec2.us-east-1.amazonaws.com", + "https?://ec2.(.+).amazonaws.com", ] url_paths = { diff --git a/moto/ses/urls.py b/moto/ses/urls.py index e67423c97..acdc49c82 100644 --- a/moto/ses/urls.py +++ b/moto/ses/urls.py @@ -1,7 +1,7 @@ from .responses import EmailResponse url_bases = [ - "https?://email.us-east-1.amazonaws.com" + "https?://email.(.+).amazonaws.com" ] url_paths = { diff --git a/tests/test_dynamodb/test_dynamodb.py b/tests/test_dynamodb/test_dynamodb.py index c3582d7c4..5a2f36321 100644 --- a/tests/test_dynamodb/test_dynamodb.py +++ b/tests/test_dynamodb/test_dynamodb.py @@ -43,3 +43,12 @@ def test_sts_handler(): res = requests.post("https://sts.amazonaws.com/", data={"GetSessionToken": ""}) res.ok.should.be.ok res.text.should.contain("SecretAccessKey") + + +@mock_dynamodb +def test_dynamodb_with_connect_to_region(): + # this will work if connected with boto.connect_dynamodb() + dynamodb = boto.dynamodb.connect_to_region('us-west-2') + + schema = dynamodb.create_schema('column1', str(), 'column2', int()) + dynamodb.create_table('table1', schema, 200, 200)