Skip to content

Commit

Permalink
Update generated code (#1675)
Browse files Browse the repository at this point in the history
* update generated code

* Update src/Service/CloudWatchLogs/CHANGELOG.md

---------

Co-authored-by: Jérémy Derussé <jeremy@derusse.com>
  • Loading branch information
async-aws-bot and jderusse authored Mar 1, 2024
1 parent e048ccd commit ffd02ec
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## NOT RELEASED

### Added

- AWS api-change: refine the list of available regions

## 2.1.1

### Changed
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "2.1-dev"
"dev-master": "2.2-dev"
}
}
}
59 changes: 53 additions & 6 deletions src/CloudWatchLogsClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
use AsyncAws\Core\AwsError\AwsErrorFactoryInterface;
use AsyncAws\Core\AwsError\JsonRpcAwsErrorFactory;
use AsyncAws\Core\Configuration;
use AsyncAws\Core\Exception\UnsupportedRegion;
use AsyncAws\Core\RequestContext;
use AsyncAws\Core\Result;

Expand Down Expand Up @@ -304,6 +305,41 @@ 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 '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 'sa-east-1':
case 'us-east-1':
case 'us-east-2':
case 'us-west-1':
case 'us-west-2':
return [
'endpoint' => "https://logs.$region.amazonaws.com",
'signRegion' => $region,
'signService' => 'logs',
'signVersions' => ['v4'],
];
case 'cn-north-1':
case 'cn-northwest-1':
return [
Expand All @@ -312,6 +348,20 @@ protected function getEndpointMetadata(?string $region): array
'signService' => 'logs',
'signVersions' => ['v4'],
];
case 'fips-ca-central-1':
return [
'endpoint' => 'https://logs-fips.ca-central-1.amazonaws.com',
'signRegion' => 'ca-central-1',
'signService' => 'logs',
'signVersions' => ['v4'],
];
case 'fips-ca-west-1':
return [
'endpoint' => 'https://logs-fips.ca-west-1.amazonaws.com',
'signRegion' => 'ca-west-1',
'signService' => 'logs',
'signVersions' => ['v4'],
];
case 'fips-us-east-1':
return [
'endpoint' => 'https://logs-fips.us-east-1.amazonaws.com',
Expand Down Expand Up @@ -341,13 +391,15 @@ protected function getEndpointMetadata(?string $region): array
'signVersions' => ['v4'],
];
case 'fips-us-gov-east-1':
case 'us-gov-east-1':
return [
'endpoint' => 'https://logs.us-gov-east-1.amazonaws.com',
'signRegion' => 'us-gov-east-1',
'signService' => 'logs',
'signVersions' => ['v4'],
];
case 'fips-us-gov-west-1':
case 'us-gov-west-1':
return [
'endpoint' => 'https://logs.us-gov-west-1.amazonaws.com',
'signRegion' => 'us-gov-west-1',
Expand All @@ -371,11 +423,6 @@ protected function getEndpointMetadata(?string $region): array
];
}

return [
'endpoint' => "https://logs.$region.amazonaws.com",
'signRegion' => $region,
'signService' => 'logs',
'signVersions' => ['v4'],
];
throw new UnsupportedRegion(sprintf('The region "%s" is not supported by "CloudWatchLogs".', $region));
}
}

0 comments on commit ffd02ec

Please sign in to comment.