aws-cdk-lib
Version:
Version 2 of the AWS Cloud Development Kit library
2 lines (1 loc) • 1.38 kB
JavaScript
Object.defineProperty(exports,"__esModule",{value:!0}),exports.PipelineQueries=void 0;var core_1=()=>{var tmp=require("../../../core");return core_1=()=>tmp,tmp};class PipelineQueries{constructor(pipeline){this.pipeline=pipeline}stackOutputsReferenced(stack){const steps=new Array;for(const wave of this.pipeline.waves){steps.push(...wave.pre,...wave.post);for(const stage of wave.stages){steps.push(...stage.pre,...stage.post);for(const stackDeployment of stage.stacks)steps.push(...stackDeployment.pre,...stackDeployment.changeSet,...stackDeployment.post)}}const ret=new Array;for(const step of steps)for(const outputRef of step.consumedStackOutputs)outputRef.isProducedBy(stack)&&ret.push(outputRef.outputName);return ret}producingStack(outputReference){for(const wave of this.pipeline.waves)for(const stage of wave.stages)for(const stack of stage.stacks)if(outputReference.isProducedBy(stack))return stack;throw new(core_1()).ValidationError(`Stack '${outputReference.stackDescription}' (producing output '${outputReference.outputName}') is not in the pipeline; call 'addStage()' to add the stack's Stage to the pipeline`,this.pipeline)}assetsInStage(stage){const assets=new Map;for(const stack of stage.stacks)for(const asset of stack.assets)assets.set(asset.assetSelector,asset);return Array.from(assets.values())}}exports.PipelineQueries=PipelineQueries;
;