Skip to content

Commit

Permalink
fix(clients): update endpoint provider (#1824)
Browse files Browse the repository at this point in the history
* generate endpoint from the EndpointPrefix trait introduced in Smithy 1.5.0
* update all the endpoint.ts as of 2020/12/21
  • Loading branch information
AllanZhengYP authored Dec 22, 2020
1 parent dd04fa3 commit 64d2210
Show file tree
Hide file tree
Showing 255 changed files with 12,658 additions and 1,325 deletions.
183 changes: 183 additions & 0 deletions clients/client-accessanalyzer/endpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const AWS_US_GOV_TEMPLATE = "access-analyzer.{region}.amazonaws.com";

// Partition regions
const AWS_REGIONS = new Set([
"af-south-1",
"ap-east-1",
"ap-northeast-1",
"ap-northeast-2",
Expand All @@ -18,6 +19,7 @@ const AWS_REGIONS = new Set([
"ca-central-1",
"eu-central-1",
"eu-north-1",
"eu-south-1",
"eu-west-1",
"eu-west-2",
"eu-west-3",
Expand All @@ -37,6 +39,187 @@ export const defaultRegionInfoProvider: RegionInfoProvider = (region: string, op
let regionInfo: RegionInfo | undefined = undefined;
switch (region) {
// First, try to match exact region names.
case "af-south-1":
regionInfo = {
hostname: "access-analyzer.af-south-1.amazonaws.com",
partition: "aws",
};
break;
case "ap-east-1":
regionInfo = {
hostname: "access-analyzer.ap-east-1.amazonaws.com",
partition: "aws",
};
break;
case "ap-northeast-1":
regionInfo = {
hostname: "access-analyzer.ap-northeast-1.amazonaws.com",
partition: "aws",
};
break;
case "ap-northeast-2":
regionInfo = {
hostname: "access-analyzer.ap-northeast-2.amazonaws.com",
partition: "aws",
};
break;
case "ap-south-1":
regionInfo = {
hostname: "access-analyzer.ap-south-1.amazonaws.com",
partition: "aws",
};
break;
case "ap-southeast-1":
regionInfo = {
hostname: "access-analyzer.ap-southeast-1.amazonaws.com",
partition: "aws",
};
break;
case "ap-southeast-2":
regionInfo = {
hostname: "access-analyzer.ap-southeast-2.amazonaws.com",
partition: "aws",
};
break;
case "ca-central-1":
regionInfo = {
hostname: "access-analyzer.ca-central-1.amazonaws.com",
partition: "aws",
};
break;
case "cn-north-1":
regionInfo = {
hostname: "access-analyzer.cn-north-1.amazonaws.com.cn",
partition: "aws-cn",
};
break;
case "cn-northwest-1":
regionInfo = {
hostname: "access-analyzer.cn-northwest-1.amazonaws.com.cn",
partition: "aws-cn",
};
break;
case "eu-central-1":
regionInfo = {
hostname: "access-analyzer.eu-central-1.amazonaws.com",
partition: "aws",
};
break;
case "eu-north-1":
regionInfo = {
hostname: "access-analyzer.eu-north-1.amazonaws.com",
partition: "aws",
};
break;
case "eu-south-1":
regionInfo = {
hostname: "access-analyzer.eu-south-1.amazonaws.com",
partition: "aws",
};
break;
case "eu-west-1":
regionInfo = {
hostname: "access-analyzer.eu-west-1.amazonaws.com",
partition: "aws",
};
break;
case "eu-west-2":
regionInfo = {
hostname: "access-analyzer.eu-west-2.amazonaws.com",
partition: "aws",
};
break;
case "eu-west-3":
regionInfo = {
hostname: "access-analyzer.eu-west-3.amazonaws.com",
partition: "aws",
};
break;
case "fips-ca-central-1":
regionInfo = {
hostname: "access-analyzer-fips.ca-central-1.amazonaws.com",
partition: "aws",
signingRegion: "ca-central-1",
};
break;
case "fips-us-east-1":
regionInfo = {
hostname: "access-analyzer-fips.us-east-1.amazonaws.com",
partition: "aws",
signingRegion: "us-east-1",
};
break;
case "fips-us-east-2":
regionInfo = {
hostname: "access-analyzer-fips.us-east-2.amazonaws.com",
partition: "aws",
signingRegion: "us-east-2",
};
break;
case "fips-us-west-1":
regionInfo = {
hostname: "access-analyzer-fips.us-west-1.amazonaws.com",
partition: "aws",
signingRegion: "us-west-1",
};
break;
case "fips-us-west-2":
regionInfo = {
hostname: "access-analyzer-fips.us-west-2.amazonaws.com",
partition: "aws",
signingRegion: "us-west-2",
};
break;
case "me-south-1":
regionInfo = {
hostname: "access-analyzer.me-south-1.amazonaws.com",
partition: "aws",
};
break;
case "sa-east-1":
regionInfo = {
hostname: "access-analyzer.sa-east-1.amazonaws.com",
partition: "aws",
};
break;
case "us-east-1":
regionInfo = {
hostname: "access-analyzer.us-east-1.amazonaws.com",
partition: "aws",
};
break;
case "us-east-2":
regionInfo = {
hostname: "access-analyzer.us-east-2.amazonaws.com",
partition: "aws",
};
break;
case "us-gov-east-1":
regionInfo = {
hostname: "access-analyzer.us-gov-east-1.amazonaws.com",
partition: "aws-us-gov",
signingRegion: "us-gov-east-1",
};
break;
case "us-gov-west-1":
regionInfo = {
hostname: "access-analyzer.us-gov-west-1.amazonaws.com",
partition: "aws-us-gov",
signingRegion: "us-gov-west-1",
};
break;
case "us-west-1":
regionInfo = {
hostname: "access-analyzer.us-west-1.amazonaws.com",
partition: "aws",
};
break;
case "us-west-2":
regionInfo = {
hostname: "access-analyzer.us-west-2.amazonaws.com",
partition: "aws",
};
break;
// Next, try to match partition endpoints.
default:
if (AWS_REGIONS.has(region)) {
Expand Down
63 changes: 63 additions & 0 deletions clients/client-acm-pca/endpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const AWS_US_GOV_TEMPLATE = "acm-pca.{region}.amazonaws.com";

// Partition regions
const AWS_REGIONS = new Set([
"af-south-1",
"ap-east-1",
"ap-northeast-1",
"ap-northeast-2",
Expand All @@ -18,6 +19,7 @@ const AWS_REGIONS = new Set([
"ca-central-1",
"eu-central-1",
"eu-north-1",
"eu-south-1",
"eu-west-1",
"eu-west-2",
"eu-west-3",
Expand All @@ -37,6 +39,12 @@ export const defaultRegionInfoProvider: RegionInfoProvider = (region: string, op
let regionInfo: RegionInfo | undefined = undefined;
switch (region) {
// First, try to match exact region names.
case "af-south-1":
regionInfo = {
hostname: "acm-pca.af-south-1.amazonaws.com",
partition: "aws",
};
break;
case "ap-east-1":
regionInfo = {
hostname: "acm-pca.ap-east-1.amazonaws.com",
Expand Down Expand Up @@ -91,6 +99,12 @@ export const defaultRegionInfoProvider: RegionInfoProvider = (region: string, op
partition: "aws",
};
break;
case "eu-south-1":
regionInfo = {
hostname: "acm-pca.eu-south-1.amazonaws.com",
partition: "aws",
};
break;
case "eu-west-1":
regionInfo = {
hostname: "acm-pca.eu-west-1.amazonaws.com",
Expand All @@ -109,6 +123,55 @@ export const defaultRegionInfoProvider: RegionInfoProvider = (region: string, op
partition: "aws",
};
break;
case "fips-ca-central-1":
regionInfo = {
hostname: "acm-pca-fips.ca-central-1.amazonaws.com",
partition: "aws",
signingRegion: "ca-central-1",
};
break;
case "fips-us-east-1":
regionInfo = {
hostname: "acm-pca-fips.us-east-1.amazonaws.com",
partition: "aws",
signingRegion: "us-east-1",
};
break;
case "fips-us-east-2":
regionInfo = {
hostname: "acm-pca-fips.us-east-2.amazonaws.com",
partition: "aws",
signingRegion: "us-east-2",
};
break;
case "fips-us-gov-east-1":
regionInfo = {
hostname: "acm-pca.us-gov-east-1.amazonaws.com",
partition: "aws-us-gov",
signingRegion: "us-gov-east-1",
};
break;
case "fips-us-gov-west-1":
regionInfo = {
hostname: "acm-pca.us-gov-west-1.amazonaws.com",
partition: "aws-us-gov",
signingRegion: "us-gov-west-1",
};
break;
case "fips-us-west-1":
regionInfo = {
hostname: "acm-pca-fips.us-west-1.amazonaws.com",
partition: "aws",
signingRegion: "us-west-1",
};
break;
case "fips-us-west-2":
regionInfo = {
hostname: "acm-pca-fips.us-west-2.amazonaws.com",
partition: "aws",
signingRegion: "us-west-2",
};
break;
case "me-south-1":
regionInfo = {
hostname: "acm-pca.me-south-1.amazonaws.com",
Expand Down
Loading

0 comments on commit 64d2210

Please sign in to comment.