diff --git a/manifest.json b/manifest.json index 60fe4ea3b..4949e1750 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { "variables": { - "${LATEST}": "3.342.2" + "${LATEST}": "3.342.3" }, "endpoints": "https://raw.githubusercontent.com/aws/aws-sdk-php/${LATEST}/src/data/endpoints.json", "services": { diff --git a/src/Service/Sns/CHANGELOG.md b/src/Service/Sns/CHANGELOG.md index b99970f0f..ffbfe3079 100644 --- a/src/Service/Sns/CHANGELOG.md +++ b/src/Service/Sns/CHANGELOG.md @@ -2,6 +2,10 @@ ## NOT RELEASED +### Added + +- AWS api-change: Make supported regions explicit + ## 1.8.0 ### Added diff --git a/src/Service/Sns/composer.json b/src/Service/Sns/composer.json index e061f2493..d6424f3fa 100644 --- a/src/Service/Sns/composer.json +++ b/src/Service/Sns/composer.json @@ -28,7 +28,7 @@ }, "extra": { "branch-alias": { - "dev-master": "1.8-dev" + "dev-master": "1.9-dev" } } } diff --git a/src/Service/Sns/src/SnsClient.php b/src/Service/Sns/src/SnsClient.php index 34c9102b2..63dd3fef2 100644 --- a/src/Service/Sns/src/SnsClient.php +++ b/src/Service/Sns/src/SnsClient.php @@ -6,6 +6,7 @@ use AsyncAws\Core\AwsError\AwsErrorFactoryInterface; use AsyncAws\Core\AwsError\XmlAwsErrorFactory; use AsyncAws\Core\Configuration; +use AsyncAws\Core\Exception\UnsupportedRegion; use AsyncAws\Core\RequestContext; use AsyncAws\Core\Result; use AsyncAws\Sns\Exception\AuthorizationErrorException; @@ -547,6 +548,44 @@ protected function getEndpointMetadata(?string $region): array } switch ($region) { + case 'af-south-1': + case 'ap-east-1': + case 'ap-northeast-1': + case 'ap-northeast-2': + case 'ap-northeast-3': + case 'ap-south-1': + case 'ap-south-2': + case 'ap-southeast-1': + case 'ap-southeast-2': + case 'ap-southeast-3': + case 'ap-southeast-4': + case 'ap-southeast-5': + case 'ap-southeast-7': + case 'ca-central-1': + case 'ca-west-1': + case 'eu-central-1': + case 'eu-central-2': + case 'eu-north-1': + case 'eu-south-1': + case 'eu-south-2': + case 'eu-west-1': + case 'eu-west-2': + case 'eu-west-3': + case 'il-central-1': + case 'me-central-1': + case 'me-south-1': + case 'mx-central-1': + case 'sa-east-1': + case 'us-east-1': + case 'us-east-2': + case 'us-west-1': + case 'us-west-2': + return [ + 'endpoint' => "https://sns.$region.amazonaws.com", + 'signRegion' => $region, + 'signService' => 'sns', + 'signVersions' => ['v4'], + ]; case 'cn-north-1': case 'cn-northwest-1': return [ @@ -591,6 +630,7 @@ protected function getEndpointMetadata(?string $region): array 'signVersions' => ['v4'], ]; case 'fips-us-gov-east-1': + case 'us-gov-east-1': return [ 'endpoint' => 'https://sns.us-gov-east-1.amazonaws.com', 'signRegion' => 'us-gov-east-1', @@ -598,6 +638,7 @@ protected function getEndpointMetadata(?string $region): array 'signVersions' => ['v4'], ]; case 'fips-us-gov-west-1': + case 'us-gov-west-1': return [ 'endpoint' => 'https://sns.us-gov-west-1.amazonaws.com', 'signRegion' => 'us-gov-west-1', @@ -629,11 +670,6 @@ protected function getEndpointMetadata(?string $region): array ]; } - return [ - 'endpoint' => "https://sns.$region.amazonaws.com", - 'signRegion' => $region, - 'signService' => 'sns', - 'signVersions' => ['v4'], - ]; + throw new UnsupportedRegion(\sprintf('The region "%s" is not supported by "Sns".', $region)); } }