Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(region-info): Add AppConfig Lambda Layer ARNs #27176

Merged
merged 10 commits into from
Sep 19, 2023
Merged
62 changes: 62 additions & 0 deletions packages/aws-cdk-lib/region-info/build-tools/fact-tables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,68 @@ export const APPMESH_ECR_ACCOUNTS: { [region: string]: string } = {
'us-west-2': '840364872350',
};

// https://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-integration-lambda-extensions-versions.html
export const APPCONFIG_LAMBDA_LAYER_ARNS: { [key: string]: any } = {
zeyad001 marked this conversation as resolved.
Show resolved Hide resolved
'2.0.181': {
arm64: {
'af-south-1': 'arn:aws:lambda:af-south-1:574348263942:layer:AWS-AppConfig-Extension-Arm64:1',
'ap-east-1': 'arn:aws:lambda:ap-east-1:630222743974:layer:AWS-AppConfig-Extension-Arm64:1',
'ap-northeast-1': 'arn:aws:lambda:ap-northeast-1:980059726660:layer:AWS-AppConfig-Extension-Arm64:37',
'ap-northeast-2': 'arn:aws:lambda:ap-northeast-2:826293736237:layer:AWS-AppConfig-Extension-Arm64:1',
'ap-northeast-3': 'arn:aws:lambda:ap-northeast-3:706869817123:layer:AWS-AppConfig-Extension-Arm64:1',
'ap-south-1': 'arn:aws:lambda:ap-south-1:554480029851:layer:AWS-AppConfig-Extension-Arm64:36',
'ap-southeast-1': 'arn:aws:lambda:ap-southeast-1:421114256042:layer:AWS-AppConfig-Extension-Arm64:43',
'ap-southeast-2': 'arn:aws:lambda:ap-southeast-2:080788657173:layer:AWS-AppConfig-Extension-Arm64:36',
'ap-southeast-3': 'arn:aws:lambda:ap-southeast-3:418787028745:layer:AWS-AppConfig-Extension-Arm64:1',
'ca-central-1': 'arn:aws:lambda:ca-central-1:039592058896:layer:AWS-AppConfig-Extension-Arm64:1',
'eu-central-1': 'arn:aws:lambda:eu-central-1:066940009817:layer:AWS-AppConfig-Extension-Arm64:36',
'eu-north-1': 'arn:aws:lambda:eu-north-1:646970417810:layer:AWS-AppConfig-Extension-Arm64:1',
'eu-south-1': 'arn:aws:lambda:eu-south-1:203683718741:layer:AWS-AppConfig-Extension-Arm64:1',
'eu-west-1': 'arn:aws:lambda:eu-west-1:434848589818:layer:AWS-AppConfig-Extension-Arm64:48',
'eu-west-2': 'arn:aws:lambda:eu-west-2:282860088358:layer:AWS-AppConfig-Extension-Arm64:33',
'eu-west-3': 'arn:aws:lambda:eu-west-3:493207061005:layer:AWS-AppConfig-Extension-Arm64:1',
'me-south-1': 'arn:aws:lambda:me-south-1:559955524753:layer:AWS-AppConfig-Extension-Arm64:1',
'sa-east-1': 'arn:aws:lambda:sa-east-1:000010852771:layer:AWS-AppConfig-Extension-Arm64:1',
'us-east-1': 'arn:aws:lambda:us-east-1:027255383542:layer:AWS-AppConfig-Extension-Arm64:46',
'us-east-2': 'arn:aws:lambda:us-east-2:728743619870:layer:AWS-AppConfig-Extension-Arm64:33',
'us-west-1': 'arn:aws:lambda:us-west-1:958113053741:layer:AWS-AppConfig-Extension-Arm64:1',
'us-west-2': 'arn:aws:lambda:us-west-2:359756378197:layer:AWS-AppConfig-Extension-Arm64:48',
},
x86_64: {
'af-south-1': 'arn:aws:lambda:af-south-1:574348263942:layer:AWS-AppConfig-Extension:73',
'ap-east-1': 'arn:aws:lambda:ap-east-1:630222743974:layer:AWS-AppConfig-Extension:73',
'ap-northeast-1': 'arn:aws:lambda:ap-northeast-1:980059726660:layer:AWS-AppConfig-Extension:84',
'ap-northeast-2': 'arn:aws:lambda:ap-northeast-2:826293736237:layer:AWS-AppConfig-Extension:93',
'ap-northeast-3': 'arn:aws:lambda:ap-northeast-3:706869817123:layer:AWS-AppConfig-Extension:86',
'ap-south-1': 'arn:aws:lambda:ap-south-1:554480029851:layer:AWS-AppConfig-Extension:94',
'ap-south-2': 'arn:aws:lambda:ap-south-2:489524808438:layer:AWS-AppConfig-Extension:32',
'ap-southeast-1': 'arn:aws:lambda:ap-southeast-1:421114256042:layer:AWS-AppConfig-Extension:91',
'ap-southeast-2': 'arn:aws:lambda:ap-southeast-2:080788657173:layer:AWS-AppConfig-Extension:93',
'ap-southeast-3': 'arn:aws:lambda:ap-southeast-3:418787028745:layer:AWS-AppConfig-Extension:64',
'ca-central-1': 'arn:aws:lambda:ca-central-1:039592058896:layer:AWS-AppConfig-Extension:81',
'cn-north-1': 'arn:aws-cn:lambda:cn-north-1:615057806174:layer:AWS-AppConfig-Extension:68',
'cn-northwest-1': 'arn:aws-cn:lambda:cn-northwest-1:615084187847:layer:AWS-AppConfig-Extension:68',
'eu-central-1': 'arn:aws:lambda:eu-central-1:066940009817:layer:AWS-AppConfig-Extension:93',
'eu-central-2': 'arn:aws:lambda:eu-central-2:758369105281:layer:AWS-AppConfig-Extension:32',
'eu-north-1': 'arn:aws:lambda:eu-north-1:646970417810:layer:AWS-AppConfig-Extension:142',
'eu-south-1': 'arn:aws:lambda:eu-south-1:203683718741:layer:AWS-AppConfig-Extension:73',
'eu-south-2': 'arn:aws:lambda:eu-south-2:586093569114:layer:AWS-AppConfig-Extension:29',
'eu-west-1': 'arn:aws:lambda:eu-west-1:434848589818:layer:AWS-AppConfig-Extension:110',
'eu-west-2': 'arn:aws:lambda:eu-west-2:282860088358:layer:AWS-AppConfig-Extension:81',
'eu-west-3': 'arn:aws:lambda:eu-west-3:493207061005:layer:AWS-AppConfig-Extension:82',
'me-central-1': 'arn:aws:lambda:me-central-1:662846165436:layer:AWS-AppConfig-Extension:34',
'me-south-1': 'arn:aws:lambda:me-south-1:559955524753:layer:AWS-AppConfig-Extension:73',
'sa-east-1': 'arn:aws:lambda:sa-east-1:000010852771:layer:AWS-AppConfig-Extension:113',
'us-east-1': 'arn:aws:lambda:us-east-1:027255383542:layer:AWS-AppConfig-Extension:113',
'us-east-2': 'arn:aws:lambda:us-east-2:728743619870:layer:AWS-AppConfig-Extension:81',
'us-gov-east-1': 'arn:aws-us-gov:lambda:us-gov-east-1:946561847325:layer:AWS-AppConfig-Extension:46',
'us-gov-west-1': 'arn:aws-us-gov:lambda:us-gov-west-1:946746059096:layer:AWS-AppConfig-Extension:46',
'us-west-1': 'arn:aws:lambda:us-west-1:958113053741:layer:AWS-AppConfig-Extension:124',
'us-west-2': 'arn:aws:lambda:us-west-2:359756378197:layer:AWS-AppConfig-Extension:146',
},
},
};

// https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Lambda-Insights-extension-versions.html
export const CLOUDWATCH_LAMBDA_INSIGHTS_ARNS: { [key: string]: any } = {
'1.0.229.0': {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
EBS_ENV_ENDPOINT_HOSTED_ZONE_IDS,
ADOT_LAMBDA_LAYER_ARNS,
PARAMS_AND_SECRETS_LAMBDA_LAYER_ARNS,
APPCONFIG_LAMBDA_LAYER_ARNS,
} from './fact-tables';
import {
AWS_REGIONS,
Expand All @@ -29,6 +30,7 @@ export async function main(): Promise<void> {
checkRegions(FIREHOSE_CIDR_BLOCKS);
checkRegions(ROUTE_53_BUCKET_WEBSITE_ZONE_IDS);
checkRegionsSubMap(CLOUDWATCH_LAMBDA_INSIGHTS_ARNS);
checkRegionsSubMap(APPCONFIG_LAMBDA_LAYER_ARNS);

const lines = [
"import { Fact, FactName } from './fact';",
Expand Down Expand Up @@ -101,6 +103,12 @@ export async function main(): Promise<void> {
}
}

for (const version in APPCONFIG_LAMBDA_LAYER_ARNS) {
for (const arch in APPCONFIG_LAMBDA_LAYER_ARNS[version]) {
registerFact(region, ['appConfigLambdaLayerVersion', version, arch], APPCONFIG_LAMBDA_LAYER_ARNS[version][arch][region]);
}
}

for (const type in ADOT_LAMBDA_LAYER_ARNS) {
for (const version in ADOT_LAMBDA_LAYER_ARNS[type]) {
for (const arch in ADOT_LAMBDA_LAYER_ARNS[type][version]) {
Expand Down
10 changes: 10 additions & 0 deletions packages/aws-cdk-lib/region-info/lib/fact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,16 @@ export class FactName {
return `cloudwatch-lambda-insights-version:${suffix}`;
}

/**
* The ARN of AppConfig Lambda Layer for a given version (e.g. 2.0.181)
* @param version The layer version.
* @param arch The architecture (optional), defaults to x86_64.
*/
public static appConfigLambdaLayerVersion(version: string, arch?: string) {
const suffix = version.split('.').join('_') + `_${arch ?? 'x86_64'}`;
return `appconfig-lambda-layer:${suffix}`;
}

/**
* The name of the regional service principal for a given service.
*
Expand Down
9 changes: 9 additions & 0 deletions packages/aws-cdk-lib/region-info/lib/region-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,15 @@ export class RegionInfo {
return Fact.find(this.name, FactName.cloudwatchLambdaInsightsVersion(insightsVersion, architecture));
}

/**
* The ARN of the AppConfig Lambda Layer, for the given version.
* @param layerVersion the version (e.g. 2.0.181)
zeyad001 marked this conversation as resolved.
Show resolved Hide resolved
* @param architecture The Lambda Function architecture (e.g. 'x86_64' or 'arm64')
zeyad001 marked this conversation as resolved.
Show resolved Hide resolved
*/
public appConfigLambdaArn(layerVersion: string, architecture?: string) : string | undefined {
return Fact.find(this.name, FactName.appConfigLambdaLayerVersion(layerVersion, architecture));
}

/**
* The ID of the AWS account that owns the public ECR repository that contains the
* AWS App Mesh Envoy Proxy images in a given region.
Expand Down
Loading