Skip to content

Commit

Permalink
chore(region-info): move the AWS_CDK_METADATA set to its own file (#2…
Browse files Browse the repository at this point in the history
…7887)

In the future, the `AWS_CDK_METADATA` set will only be edited automatically, to prevent misconfiguration. Moving it to its own file makes it easier and less error prone for automated tools to generate/update the code.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
otaviomacedo authored Nov 8, 2023
1 parent de0a9e2 commit 02957df
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 38 deletions.
37 changes: 0 additions & 37 deletions packages/aws-cdk-lib/region-info/build-tools/fact-tables.ts
Original file line number Diff line number Diff line change
@@ -1,41 +1,4 @@
/* eslint-disable @aws-cdk/no-literal-partition */
export const AWS_CDK_METADATA = new Set([
'af-south-1',
'ap-east-1',
'ap-northeast-1',
'ap-northeast-2',
// 'ap-northeast-3',
'ap-south-1',
// 'ap-south-2',
'ap-southeast-1',
'ap-southeast-2',
// 'ap-southeast-3',
// 'ap-southeast-4',
'ca-central-1',
'cn-north-1',
'cn-northwest-1',
'eu-central-1',
// 'eu-central-2',
'eu-north-1',
'eu-south-1',
// 'eu-south-2',
'eu-west-1',
'eu-west-2',
'eu-west-3',
// 'il-central-1',
// 'me-central-1',
'me-south-1',
'sa-east-1',
'us-east-1',
'us-east-2',
// 'us-gov-east-1',
// 'us-gov-west-1',
// 'us-iso-east-1',
// 'us-isob-east-1',
'us-west-1',
'us-west-2',
]);

/**
* The hosted zone Id if using an alias record in Route53.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import * as path from 'path';
import * as fs from 'fs-extra';
import {
APPMESH_ECR_ACCOUNTS,
AWS_CDK_METADATA,
CLOUDWATCH_LAMBDA_INSIGHTS_ARNS,
DLC_REPOSITORY_ACCOUNTS,
ELBV2_ACCOUNTS,
Expand All @@ -14,6 +13,7 @@ import {
PARAMS_AND_SECRETS_LAMBDA_LAYER_ARNS,
APPCONFIG_LAMBDA_LAYER_ARNS,
} from './fact-tables';
import { AWS_CDK_METADATA } from './metadata';
import {
AWS_REGIONS,
AWS_SERVICES,
Expand Down
33 changes: 33 additions & 0 deletions packages/aws-cdk-lib/region-info/build-tools/metadata.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Do not edit this file manually. To prevent misconfiguration, this file
* should only be modified by an automated GitHub workflow, that ensures
* that the regions present in this list correspond to all the regions
* where we have the AWS::CDK::Metadata handler deployed.
*
* See: https://github.com/aws/aws-cdk/issues/27189
*/

export const AWS_CDK_METADATA = new Set([
'af-south-1',
'ap-east-1',
'ap-northeast-1',
'ap-northeast-2',
'ap-south-1',
'ap-southeast-1',
'ap-southeast-2',
'ca-central-1',
'cn-north-1',
'cn-northwest-1',
'eu-central-1',
'eu-north-1',
'eu-south-1',
'eu-west-1',
'eu-west-2',
'eu-west-3',
'me-south-1',
'sa-east-1',
'us-east-1',
'us-east-2',
'us-west-1',
'us-west-2',
]);

0 comments on commit 02957df

Please sign in to comment.