aws-cdk-lib
Version:
Version 2 of the AWS Cloud Development Kit library
2 lines (1 loc) • 2.57 kB
JavaScript
var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.ProductStack=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var crypto=()=>{var tmp=require("crypto");return crypto=()=>tmp,tmp},fs=()=>{var tmp=require("fs");return fs=()=>tmp,tmp},path=()=>{var tmp=require("path");return path=()=>tmp,tmp},product_stack_synthesizer_1=()=>{var tmp=require("./private/product-stack-synthesizer");return product_stack_synthesizer_1=()=>tmp,tmp},cdk=()=>{var tmp=require("../../core");return cdk=()=>tmp,tmp};class ProductStack extends cdk().Stack{constructor(scope,id,props={}){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_servicecatalog_ProductStackProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,ProductStack),error}const parentStack=findParentStack(scope);super(scope,id,{analyticsReporting:props.analyticsReporting,description:props.description,synthesizer:new(product_stack_synthesizer_1()).ProductStackSynthesizer({parentStack,assetBucket:props.assetBucket,serverSideEncryption:props.serverSideEncryption,serverSideEncryptionAwsKmsKeyId:props.serverSideEncryptionAwsKmsKeyId,memoryLimit:props.memoryLimit})}),this._parentStack=parentStack,this.templateFile=`${cdk().Names.uniqueId(this)}.product.template.json`,this.assetBucket=props.assetBucket}_setParentProductStackHistory(parentProductStackHistory){return this._parentProductStackHistory=parentProductStackHistory}_getTemplateUrl(){return cdk().Lazy.uncachedString({produce:()=>this._templateUrl})}_getAssetBucket(){return this.assetBucket}_getParentStack(){return this._parentStack}_synthesizeTemplate(session){const cfn=JSON.stringify(this._toCloudFormation(),void 0,2),templateHash=crypto().createHash("sha256").update(cfn).digest("hex");this._templateUrl=this._parentStack.synthesizer.addFileAsset({packaging:cdk().FileAssetPackaging.FILE,sourceHash:templateHash,fileName:this.templateFile}).httpUrl,this._parentProductStackHistory&&this._parentProductStackHistory._writeTemplateToSnapshot(cfn),fs().writeFileSync(path().join(session.assembly.outdir,this.templateFile),cfn)}}exports.ProductStack=ProductStack,_a=JSII_RTTI_SYMBOL_1,ProductStack[_a]={fqn:"aws-cdk-lib.aws_servicecatalog.ProductStack",version:"2.185.0"};function findParentStack(scope){try{return cdk().Stack.of(scope)}catch{throw new Error("Product stacks must be defined within scope of another non-product stack")}}
;