aws-cdk-lib
Version:
Version 2 of the AWS Cloud Development Kit library
2 lines (1 loc) • 3.4 kB
JavaScript
;Object.defineProperty(exports,"__esModule",{value:!0}),exports.LambdaInsightsVersion=void 0;const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var architecture_1=()=>{var tmp=require("./architecture");return architecture_1=()=>tmp,tmp},core_1=()=>{var tmp=require("../../core");return core_1=()=>tmp,tmp},errors_1=()=>{var tmp=require("../../core/lib/errors");return errors_1=()=>tmp,tmp},region_info_1=()=>{var tmp=require("../../region-info");return region_info_1=()=>tmp,tmp};class LambdaInsightsVersion{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_lambda.LambdaInsightsVersion",version:"2.233.0"};static VERSION_1_0_54_0=LambdaInsightsVersion.fromInsightsVersion("1.0.54.0");static VERSION_1_0_86_0=LambdaInsightsVersion.fromInsightsVersion("1.0.86.0");static VERSION_1_0_89_0=LambdaInsightsVersion.fromInsightsVersion("1.0.89.0");static VERSION_1_0_98_0=LambdaInsightsVersion.fromInsightsVersion("1.0.98.0");static VERSION_1_0_119_0=LambdaInsightsVersion.fromInsightsVersion("1.0.119.0");static VERSION_1_0_135_0=LambdaInsightsVersion.fromInsightsVersion("1.0.135.0");static VERSION_1_0_143_0=LambdaInsightsVersion.fromInsightsVersion("1.0.143.0");static VERSION_1_0_178_0=LambdaInsightsVersion.fromInsightsVersion("1.0.178.0");static VERSION_1_0_229_0=LambdaInsightsVersion.fromInsightsVersion("1.0.229.0");static VERSION_1_0_273_0=LambdaInsightsVersion.fromInsightsVersion("1.0.273.0");static VERSION_1_0_275_0=LambdaInsightsVersion.fromInsightsVersion("1.0.275.0");static VERSION_1_0_295_0=LambdaInsightsVersion.fromInsightsVersion("1.0.295.0");static VERSION_1_0_317_0=LambdaInsightsVersion.fromInsightsVersion("1.0.317.0");static VERSION_1_0_333_0=LambdaInsightsVersion.fromInsightsVersion("1.0.333.0");static VERSION_1_0_391_0=LambdaInsightsVersion.fromInsightsVersion("1.0.391.0");static VERSION_1_0_404_0=LambdaInsightsVersion.fromInsightsVersion("1.0.404.0");static VERSION_1_0_498_0=LambdaInsightsVersion.fromInsightsVersion("1.0.498.0");static fromInsightVersionArn(arn){class InsightsArn extends LambdaInsightsVersion{layerVersionArn=arn;_bind(_scope,_function){return{arn}}}return new InsightsArn}static fromInsightsVersion(insightsVersion){class InsightsVersion extends LambdaInsightsVersion{layerVersionArn=core_1().Lazy.uncachedString({produce:context=>getVersionArn(context.scope,insightsVersion)});_bind(scope,fn){const arch=fn.architecture?.name??architecture_1().Architecture.X86_64.name;if(!region_info_1().RegionInfo.regions.some(regionInfo=>regionInfo.cloudwatchLambdaInsightsArn(insightsVersion,arch)))throw new(errors_1()).ValidationError(`Insights version ${insightsVersion} does not exist.`,fn);return{arn:getVersionArn(scope,insightsVersion,arch)}}}return new InsightsVersion}layerVersionArn=""}exports.LambdaInsightsVersion=LambdaInsightsVersion;function getVersionArn(scope,insightsVersion,architecture){const scopeStack=core_1().Stack.of(scope),region=scopeStack.region,arch=architecture??architecture_1().Architecture.X86_64.name;if(region!==void 0&&!core_1().Token.isUnresolved(region)){const arn=region_info_1().RegionInfo.get(region).cloudwatchLambdaInsightsArn(insightsVersion,arch);if(arn===void 0)throw new(errors_1()).ValidationError(`Insights version ${insightsVersion} is not supported in region ${region}`,scope);return arn}return scopeStack.regionalFact(region_info_1().FactName.cloudwatchLambdaInsightsVersion(insightsVersion,arch))}