Describe the bug
In the constructor of pipelines.CodePipeline checks are done to verify that pipelineName and crossAccountKeys are not set if a pipeline is already provided through the props. However this check is missing for the reuseCrossRegionSupportStacks property.
Expected Behavior
Providing both the reuseCrossRegionSupportStacks parameter and the codePipeline parameter to a pipelines.CodePipeline should fail.
Current Behavior
However, right now: Providing both the reuseCrossRegionSupportStacks parameter and the codePipeline parameter to a pipelines.CodePipeline does not fail, although it should.
Reproduction Steps
The following should fail.
import { aws_codepipeline as cp, pipelines } from 'aws-cdk-lib';
new pipelines.CodePipeline(scope, 'CodePipeline', {
reuseCrossRegionSupportStacks: true,
codePipeline: new cp.Pipeline(scope, 'Pipeline'),
synth: new pipelines.ShellStep('Synth', { commands: ['ls'] }),
});
Possible Solution
Add the following piece of code to line 357 of the CodePipeline.
if (this.props.reuseCrossRegionSupportStacks !== undefined) {
throw new Error('Cannot set \'reuseCrossRegionSupportStacks\' if an existing CodePipeline is given using \'codePipeline\'');
}
Additional Information/Context
No response
CDK CLI Version
2.16.0 (build 4c77925)
Framework Version
No response
Node.js Version
v14.18.0
OS
MacOS
Language
Typescript
Language Version
3.9.7
Other information
No response
Describe the bug
In the constructor of pipelines.CodePipeline checks are done to verify that
pipelineNameandcrossAccountKeysare not set if a pipeline is already provided through the props. However this check is missing for thereuseCrossRegionSupportStacksproperty.Expected Behavior
Providing both the
reuseCrossRegionSupportStacksparameter and thecodePipelineparameter to a pipelines.CodePipeline should fail.Current Behavior
However, right now: Providing both the
reuseCrossRegionSupportStacksparameter and thecodePipelineparameter to a pipelines.CodePipeline does not fail, although it should.Reproduction Steps
The following should fail.
Possible Solution
Add the following piece of code to line 357 of the CodePipeline.
Additional Information/Context
No response
CDK CLI Version
2.16.0 (build 4c77925)
Framework Version
No response
Node.js Version
v14.18.0
OS
MacOS
Language
Typescript
Language Version
3.9.7
Other information
No response