【发布时间】:2022-01-14 19:03:02
【问题描述】:
我正在使用 nodejs CDK 将 codepipeline 部署到 AWS。下面是代码:
const pipeline = new codepipeline.Pipeline(this, this.projectName, {
pipelineName: this.projectName,
role: this.pipelineRole,
stages,
artifactBucket: s3.Bucket.fromBucketName(
this,
'deploymentS3Bucket',
cdk.Fn.importValue(this.s3Bucket)
),
});
它在stages 数组中定义了所有阶段。我的问题是如何在此管道的某个阶段禁用转换?
我试过下面的代码:
const primaryDeployStage: codepipeline.CfnPipeline = pipeline.node.findChild('Approve') as codepipeline.CfnPipeline;
const stageTransitionProperty: codepipeline.CfnPipeline.StageTransitionProperty = {
reason: 'reason',
stageName: 'stageName',
};
primaryDeployStage. addPropertyOverride('DisableInboundStageTransitions', stageTransitionProperty);
但它显示no such method addOverride 错误。
【问题讨论】:
-
假设此转换不会永久禁用,您是否考虑过对此用例的手动批准步骤?
标签: amazon-web-services aws-cdk aws-codepipeline