Skip to content

Commit e1d4187

Browse files
authored
chore(region-info): Add AppConfig Lambda Layer ARNs (#27176)
This PR adds the AWS AppConfig Lambda Layer ARNs (found [here in the AWS Docs](https://docs.aws.amazon.com/appconfig/latest/userguide/appconfig-integration-lambda-extensions-versions.html)) to the region information. [Previous pull request](#26873) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 70006ab commit e1d4187

File tree

6 files changed

+832
-2
lines changed

6 files changed

+832
-2
lines changed

packages/aws-cdk-lib/region-info/build-tools/fact-tables.ts

+266
Large diffs are not rendered by default.

packages/aws-cdk-lib/region-info/build-tools/generate-static-data.ts

+8
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
EBS_ENV_ENDPOINT_HOSTED_ZONE_IDS,
1313
ADOT_LAMBDA_LAYER_ARNS,
1414
PARAMS_AND_SECRETS_LAMBDA_LAYER_ARNS,
15+
APPCONFIG_LAMBDA_LAYER_ARNS,
1516
} from './fact-tables';
1617
import {
1718
AWS_REGIONS,
@@ -29,6 +30,7 @@ export async function main(): Promise<void> {
2930
checkRegions(FIREHOSE_CIDR_BLOCKS);
3031
checkRegions(ROUTE_53_BUCKET_WEBSITE_ZONE_IDS);
3132
checkRegionsSubMap(CLOUDWATCH_LAMBDA_INSIGHTS_ARNS);
33+
checkRegionsSubMap(APPCONFIG_LAMBDA_LAYER_ARNS);
3234

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

106+
for (const version in APPCONFIG_LAMBDA_LAYER_ARNS) {
107+
for (const arch in APPCONFIG_LAMBDA_LAYER_ARNS[version]) {
108+
registerFact(region, ['appConfigLambdaLayerVersion', version, arch], APPCONFIG_LAMBDA_LAYER_ARNS[version][arch][region]);
109+
}
110+
}
111+
104112
for (const type in ADOT_LAMBDA_LAYER_ARNS) {
105113
for (const version in ADOT_LAMBDA_LAYER_ARNS[type]) {
106114
for (const arch in ADOT_LAMBDA_LAYER_ARNS[type][version]) {

packages/aws-cdk-lib/region-info/lib/fact.ts

+10
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,16 @@ export class FactName {
181181
return `cloudwatch-lambda-insights-version:${suffix}`;
182182
}
183183

184+
/**
185+
* The ARN of AppConfig Lambda Layer for a given version (e.g. 2.0.181)
186+
* @param version The layer version.
187+
* @param arch The architecture (optional), defaults to x86_64.
188+
*/
189+
public static appConfigLambdaLayerVersion(version: string, arch?: string) {
190+
const suffix = version.split('.').join('_') + `_${arch ?? 'x86_64'}`;
191+
return `appconfig-lambda-layer:${suffix}`;
192+
}
193+
184194
/**
185195
* The name of the regional service principal for a given service.
186196
*

packages/aws-cdk-lib/region-info/lib/region-info.ts

+9
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,15 @@ export class RegionInfo {
153153
return Fact.find(this.name, FactName.cloudwatchLambdaInsightsVersion(insightsVersion, architecture));
154154
}
155155

156+
/**
157+
* The ARN of the AppConfig Lambda Layer, for the given version.
158+
* @param layerVersion The layer version (e.g. 2.0.181)
159+
* @param architecture The Lambda Function architecture (e.g. 'x86_64' or 'arm64'), defaults to x86_64
160+
*/
161+
public appConfigLambdaArn(layerVersion: string, architecture?: string) : string | undefined {
162+
return Fact.find(this.name, FactName.appConfigLambdaLayerVersion(layerVersion, architecture));
163+
}
164+
156165
/**
157166
* The ID of the AWS account that owns the public ECR repository that contains the
158167
* AWS App Mesh Envoy Proxy images in a given region.

0 commit comments

Comments
 (0)