File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -173,6 +173,13 @@ export interface PipelineProps {
173173 * @default - true (Use the same support stack for all pipelines in App)
174174 */
175175 readonly reuseCrossRegionSupportStacks ?: boolean ;
176+
177+ /**
178+ * Name of the pipeline.
179+ *
180+ * @default - AWS CloudFormation default.
181+ */
182+ readonly pipelineType ?: string ;
176183}
177184
178185abstract class PipelineBase extends Resource implements IPipeline {
@@ -442,6 +449,7 @@ export class Pipeline extends PipelineBase {
442449 roleArn : this . role . roleArn ,
443450 restartExecutionOnUpdate : props && props . restartExecutionOnUpdate ,
444451 name : this . physicalName ,
452+ pipelineType : props . pipelineType ,
445453 } ) ;
446454
447455 // this will produce a DependsOn for both the role and the policy resources.
Original file line number Diff line number Diff line change @@ -13,6 +13,35 @@ import * as codepipeline from '../lib';
1313
1414describe ( '' , ( ) => {
1515 describe ( 'Pipeline' , ( ) => {
16+ test ( 'can be passed PipelineType during pipeline creation' , ( ) => {
17+ const stack = new cdk . Stack ( ) ;
18+ const pipeline = new codepipeline . Pipeline ( stack , 'Pipeline' , {
19+ pipelineType : 'V1' ,
20+ } ) ;
21+
22+ // Adding 2 stages with actions so pipeline validation will pass
23+ const sourceArtifact = new codepipeline . Artifact ( ) ;
24+ pipeline . addStage ( {
25+ stageName : 'Source' ,
26+ actions : [ new FakeSourceAction ( {
27+ actionName : 'FakeSource' ,
28+ output : sourceArtifact ,
29+ } ) ] ,
30+ } ) ;
31+
32+ pipeline . addStage ( {
33+ stageName : 'Build' ,
34+ actions : [ new FakeBuildAction ( {
35+ actionName : 'FakeBuild' ,
36+ input : sourceArtifact ,
37+ } ) ] ,
38+ } ) ;
39+
40+ Template . fromStack ( stack ) . hasResourceProperties ( 'AWS::CodePipeline::Pipeline' , {
41+ 'PipelineType' : 'V1' ,
42+ } ) ;
43+ } ) ;
44+
1645 test ( 'can be passed an IAM role during pipeline creation' , ( ) => {
1746 const stack = new cdk . Stack ( ) ;
1847 const role = new iam . Role ( stack , 'Role' , {
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ module.exports = {
66
77 // Different than usual
88 testMatch : [
9- '<rootDir>/**/test/**/?(*.)+(test).ts' ,
9+ '<rootDir>/**/aws-codepipeline/ test/**/?(*.)+(test).ts' ,
1010 ] ,
1111
1212 coverageThreshold : {
You can’t perform that action at this time.
0 commit comments