[Feature Request]: Support for AWS CodePipeline V2
Describe your idea/feature/enhancement
Add support for CodePipeline V2: V2 type pipelines have the same structure as a V1 type, along with additional parameters for release safety and trigger configuration.
Proposal
The Copilot manifest could have a new parameter where we can specify which pipeline version to deploy, defaulting to V1 to maintain compatibility
Workaround
Add a CDK override to the pipeline:
-
copilot pipeline override - Select your pipeline
- Select
cdk - Change the generated
stack.tsto this:
import * as cdk from 'aws-cdk-lib';
import * as path from 'path';
import { CfnPipeline } from 'aws-cdk-lib/aws-codepipeline';
interface TransformedStackProps extends cdk.StackProps {
readonly appName: string;
}
export class TransformedStack extends cdk.Stack {
public readonly template: cdk.cloudformation_include.CfnInclude;
public readonly appName: string;
constructor (scope: cdk.App, id: string, props: TransformedStackProps) {
super(scope, id, props);
this.template = new cdk.cloudformation_include.CfnInclude(this, 'Template', {
templateFile: path.join('.build', 'in.yml'),
});
this.appName = props.appName;
this.transformService();
}
transformService() {
const service = this.template.getResource("Pipeline") as CfnPipeline;
service.addPropertyOverride("PipelineType", "V2");
}
}
- run
copilot pipeline deploy --diffand verify the output
Related https://github.com/aws/copilot-cli/issues/5751
Hi! Thanks! I was looking for this exactly. But, just to be clear, after selecting cdk in the override menu, the resource I need to select to override is Pipeline, right? I also have the option to override PipelineRole and PipelineRolePolicy but it seems to me the right option is the first one