Skip to content

Commit ef855d6

Browse files
Update generated code (#1322)
* update generated code * Update src/Service/Lambda/CHANGELOG.md Co-authored-by: Jérémy Derussé <[email protected]>
1 parent d57641f commit ef855d6

File tree

2 files changed

+37
-6
lines changed

2 files changed

+37
-6
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## NOT RELEASED
44

5+
### Added
6+
7+
- AWS api-change: Restrict the list of available regions.
8+
59
## 1.7.0
610

711
### Added

src/LambdaClient.php

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use AsyncAws\Core\AwsError\AwsErrorFactoryInterface;
77
use AsyncAws\Core\AwsError\JsonRestAwsErrorFactory;
88
use AsyncAws\Core\Configuration;
9+
use AsyncAws\Core\Exception\UnsupportedRegion;
910
use AsyncAws\Core\RequestContext;
1011
use AsyncAws\Core\Result;
1112
use AsyncAws\Lambda\Enum\Architecture;
@@ -366,6 +367,37 @@ protected function getEndpointMetadata(?string $region): array
366367
}
367368

368369
switch ($region) {
370+
case 'af-south-1':
371+
case 'ap-east-1':
372+
case 'ap-northeast-1':
373+
case 'ap-northeast-2':
374+
case 'ap-northeast-3':
375+
case 'ap-south-1':
376+
case 'ap-southeast-1':
377+
case 'ap-southeast-2':
378+
case 'ap-southeast-3':
379+
case 'ca-central-1':
380+
case 'eu-central-1':
381+
case 'eu-north-1':
382+
case 'eu-south-1':
383+
case 'eu-west-1':
384+
case 'eu-west-2':
385+
case 'eu-west-3':
386+
case 'me-central-1':
387+
case 'me-south-1':
388+
case 'sa-east-1':
389+
case 'us-east-1':
390+
case 'us-east-2':
391+
case 'us-gov-east-1':
392+
case 'us-gov-west-1':
393+
case 'us-west-1':
394+
case 'us-west-2':
395+
return [
396+
'endpoint' => "https://lambda.$region.amazonaws.com",
397+
'signRegion' => $region,
398+
'signService' => 'lambda',
399+
'signVersions' => ['v4'],
400+
];
369401
case 'cn-north-1':
370402
case 'cn-northwest-1':
371403
return [
@@ -433,11 +465,6 @@ protected function getEndpointMetadata(?string $region): array
433465
];
434466
}
435467

436-
return [
437-
'endpoint' => "https://lambda.$region.amazonaws.com",
438-
'signRegion' => $region,
439-
'signService' => 'lambda',
440-
'signVersions' => ['v4'],
441-
];
468+
throw new UnsupportedRegion(sprintf('The region "%s" is not supported by "Lambda".', $region));
442469
}
443470
}

0 commit comments

Comments
 (0)