File tree Expand file tree Collapse file tree 2 files changed +37
-6
lines changed
Expand file tree Collapse file tree 2 files changed +37
-6
lines changed Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 66use AsyncAws \Core \AwsError \AwsErrorFactoryInterface ;
77use AsyncAws \Core \AwsError \JsonRestAwsErrorFactory ;
88use AsyncAws \Core \Configuration ;
9+ use AsyncAws \Core \Exception \UnsupportedRegion ;
910use AsyncAws \Core \RequestContext ;
1011use AsyncAws \Core \Result ;
1112use 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}
You can’t perform that action at this time.
0 commit comments