Skip to content

Commit b577fca

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 5d56517 commit b577fca

File tree

1 file changed

+6
-28
lines changed

1 file changed

+6
-28
lines changed

src/LambdaClient.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\Lambda\Enum\InvocationType;
109
use AsyncAws\Lambda\Enum\LogType;
@@ -131,32 +130,6 @@ protected function getEndpointMetadata(?string $region): array
131130
}
132131

133132
switch ($region) {
134-
case 'af-south-1':
135-
case 'ap-east-1':
136-
case 'ap-northeast-1':
137-
case 'ap-northeast-2':
138-
case 'ap-south-1':
139-
case 'ap-southeast-1':
140-
case 'ap-southeast-2':
141-
case 'ca-central-1':
142-
case 'eu-central-1':
143-
case 'eu-north-1':
144-
case 'eu-south-1':
145-
case 'eu-west-1':
146-
case 'eu-west-2':
147-
case 'eu-west-3':
148-
case 'me-south-1':
149-
case 'sa-east-1':
150-
case 'us-east-1':
151-
case 'us-east-2':
152-
case 'us-west-1':
153-
case 'us-west-2':
154-
return [
155-
'endpoint' => "https://lambda.$region.amazonaws.com",
156-
'signRegion' => $region,
157-
'signService' => 'lambda',
158-
'signVersions' => ['v4'],
159-
];
160133
case 'cn-north-1':
161134
case 'cn-northwest-1':
162135
return [
@@ -231,6 +204,11 @@ protected function getEndpointMetadata(?string $region): array
231204
];
232205
}
233206

234-
throw new UnsupportedRegion(sprintf('The region "%s" is not supported by "Lambda".', $region));
207+
return [
208+
'endpoint' => "https://lambda.$region.amazonaws.com",
209+
'signRegion' => $region,
210+
'signService' => 'lambda',
211+
'signVersions' => ['v4'],
212+
];
235213
}
236214
}

0 commit comments

Comments
 (0)