aws-cdk-lib
Version:
Version 2 of the AWS Cloud Development Kit library
2 lines (1 loc) • 5.45 kB
JavaScript
var _a,_b,_c,_d;Object.defineProperty(exports,"__esModule",{value:!0}),exports.CustomResourceLambdaRuntime=exports.CustomResourceRemovalPolicy=exports.CustomResourceLogRetention=exports.CustomResourceConfig=exports.CUSTOM_RESOURCE_RUNTIME_FAMILY=exports.CUSTOM_RESOURCE_SINGLETON_LOG_RETENTION=exports.CUSTOM_RESOURCE_SINGLETON_LOG_GROUP=exports.CUSTOM_RESOURCE_SINGLETON=exports.CUSTOM_RESOURCE_PROVIDER=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var logs=()=>{var tmp=require("../../../aws-logs");return logs=()=>tmp,tmp},lib_1=()=>{var tmp=require("../../../core/lib");return lib_1=()=>tmp,tmp};exports.CUSTOM_RESOURCE_PROVIDER="aws:cdk:is-custom-resource-handler-customResourceProvider",exports.CUSTOM_RESOURCE_SINGLETON="aws:cdk:is-custom-resource-handler-singleton",exports.CUSTOM_RESOURCE_SINGLETON_LOG_GROUP="aws:cdk:is-custom-resource-handler-logGroup",exports.CUSTOM_RESOURCE_SINGLETON_LOG_RETENTION="aws:cdk:is-custom-resource-handler-logRetention",exports.CUSTOM_RESOURCE_RUNTIME_FAMILY="aws:cdk:is-custom-resource-handler-runtime-family";class CustomResourceConfig{static of(scope){return new CustomResourceConfig(scope)}constructor(scope){this.scope=scope}addLogRetentionLifetime(rentention){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_logs_RetentionDays(rentention)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.addLogRetentionLifetime),error}lib_1().Aspects.of(this.scope).add(new CustomResourceLogRetention(rentention),{priority:lib_1().AspectPriority.MUTATING})}addRemovalPolicy(removalPolicy){try{jsiiDeprecationWarnings().aws_cdk_lib_RemovalPolicy(removalPolicy)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.addRemovalPolicy),error}lib_1().Aspects.of(this.scope).add(new CustomResourceRemovalPolicy(removalPolicy),{priority:lib_1().AspectPriority.MUTATING})}addLambdaRuntime(lambdaRuntime){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_lambda_Runtime(lambdaRuntime)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.addLambdaRuntime),error}lib_1().Aspects.of(this.scope).add(new CustomResourceLambdaRuntime(lambdaRuntime),{priority:lib_1().AspectPriority.MUTATING})}}exports.CustomResourceConfig=CustomResourceConfig,_a=JSII_RTTI_SYMBOL_1,CustomResourceConfig[_a]={fqn:"aws-cdk-lib.custom_resources.CustomResourceConfig",version:"2.185.0"};class CustomResourceLogRetention{constructor(setLogRetention){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_logs_RetentionDays(setLogRetention)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CustomResourceLogRetention),error}this.logRetention=setLogRetention}visit(node){for(const metadataEntry of node.node.metadata){if(metadataEntry.type==exports.CUSTOM_RESOURCE_SINGLETON_LOG_GROUP&&node.node.defaultChild.addPropertyOverride("RetentionInDays",this.logRetention),metadataEntry.type==exports.CUSTOM_RESOURCE_SINGLETON){const localNode=node.node.defaultChild;if(localNode&&!localNode.loggingConfig){const newLogGroup=this.createLogGroup(localNode);localNode.addPropertyOverride("LoggingConfig",{LogGroup:newLogGroup.logGroupName})}}metadataEntry.type==exports.CUSTOM_RESOURCE_SINGLETON_LOG_RETENTION&&node.node.defaultChild.addPropertyOverride("RetentionInDays",this.logRetention)}}createLogGroup(scope){const newLogGroup=new(logs()).LogGroup(scope,"logGroup",{retention:this.logRetention});return newLogGroup.node.addMetadata(`${exports.CUSTOM_RESOURCE_SINGLETON_LOG_GROUP}`,!0),newLogGroup}}exports.CustomResourceLogRetention=CustomResourceLogRetention,_b=JSII_RTTI_SYMBOL_1,CustomResourceLogRetention[_b]={fqn:"aws-cdk-lib.custom_resources.CustomResourceLogRetention",version:"2.185.0"};class CustomResourceRemovalPolicy{constructor(removalPolicy){try{jsiiDeprecationWarnings().aws_cdk_lib_RemovalPolicy(removalPolicy)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CustomResourceRemovalPolicy),error}this.removalPolicy=removalPolicy}visit(node){for(const metadataEntry of node.node.metadata)metadataEntry.type==exports.CUSTOM_RESOURCE_SINGLETON_LOG_GROUP&&node.node.defaultChild.applyRemovalPolicy(this.removalPolicy)}}exports.CustomResourceRemovalPolicy=CustomResourceRemovalPolicy,_c=JSII_RTTI_SYMBOL_1,CustomResourceRemovalPolicy[_c]={fqn:"aws-cdk-lib.custom_resources.CustomResourceRemovalPolicy",version:"2.185.0"};class CustomResourceLambdaRuntime{constructor(lambdaRuntime){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_lambda_Runtime(lambdaRuntime)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CustomResourceLambdaRuntime),error}this.lambdaRuntime=lambdaRuntime}visit(node){for(const metadataEntry of node.node.metadata)metadataEntry.type==exports.CUSTOM_RESOURCE_RUNTIME_FAMILY&&metadataEntry.data==this.lambdaRuntime.family&&node.node.defaultChild.addPropertyOverride("Runtime",this.lambdaRuntime.toString())}}exports.CustomResourceLambdaRuntime=CustomResourceLambdaRuntime,_d=JSII_RTTI_SYMBOL_1,CustomResourceLambdaRuntime[_d]={fqn:"aws-cdk-lib.custom_resources.CustomResourceLambdaRuntime",version:"2.185.0"};
;