UNPKG

@amaabca/aws-lex-custom-resources

Version:
23 lines (22 loc) 781 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const constructs_1 = require("constructs"); const aws_cdk_lib_1 = require("aws-cdk-lib"); class default_1 extends constructs_1.Construct { constructor(scope, id, serviceToken, props) { super(scope, id); this.resource = new aws_cdk_lib_1.CfnResource(this, id, { type: 'Custom::LexBotVersion', properties: { ServiceToken: serviceToken, ...props, }, }); // the custom resource will take care of cleaning this up this.resource.applyRemovalPolicy(aws_cdk_lib_1.RemovalPolicy.RETAIN); } botVersion() { return this.resource.getAtt('botVersion'); } } exports.default = default_1;