Skip to content

Commit 533fe31

Browse files
jderusseNyholm
andauthored
Fix endpoint without region (#880)
* Fix endpoint without region * Fixed tests * cs fix Co-authored-by: Nyholm <[email protected]>
1 parent a4808ec commit 533fe31

File tree

1 file changed

+6
-28
lines changed

1 file changed

+6
-28
lines changed

src/DynamoDbClient.php

Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
use AsyncAws\Core\AbstractApi;
66
use AsyncAws\Core\Configuration;
7-
use AsyncAws\Core\Exception\UnsupportedRegion;
87
use AsyncAws\Core\RequestContext;
98
use AsyncAws\DynamoDb\Enum\BillingMode;
109
use AsyncAws\DynamoDb\Enum\ConditionalOperator;
@@ -482,32 +481,6 @@ protected function getEndpointMetadata(?string $region): array
482481
}
483482

484483
switch ($region) {
485-
case 'af-south-1':
486-
case 'ap-east-1':
487-
case 'ap-northeast-1':
488-
case 'ap-northeast-2':
489-
case 'ap-south-1':
490-
case 'ap-southeast-1':
491-
case 'ap-southeast-2':
492-
case 'ca-central-1':
493-
case 'eu-central-1':
494-
case 'eu-north-1':
495-
case 'eu-south-1':
496-
case 'eu-west-1':
497-
case 'eu-west-2':
498-
case 'eu-west-3':
499-
case 'me-south-1':
500-
case 'sa-east-1':
501-
case 'us-east-1':
502-
case 'us-east-2':
503-
case 'us-west-1':
504-
case 'us-west-2':
505-
return [
506-
'endpoint' => "https://dynamodb.$region.amazonaws.com",
507-
'signRegion' => $region,
508-
'signService' => 'dynamodb',
509-
'signVersions' => ['v4'],
510-
];
511484
case 'cn-north-1':
512485
case 'cn-northwest-1':
513486
return [
@@ -596,6 +569,11 @@ protected function getEndpointMetadata(?string $region): array
596569
];
597570
}
598571

599-
throw new UnsupportedRegion(sprintf('The region "%s" is not supported by "DynamoDb".', $region));
572+
return [
573+
'endpoint' => "https://dynamodb.$region.amazonaws.com",
574+
'signRegion' => $region,
575+
'signService' => 'dynamodb',
576+
'signVersions' => ['v4'],
577+
];
600578
}
601579
}

0 commit comments

Comments
 (0)