Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aws_cdk.pipelines: Type V2 CodePipelines not supported in this construct #32657

Open
2 tasks
emir-demirovic opened this issue Dec 26, 2024 · 7 comments
Open
2 tasks
Labels
@aws-cdk/pipelines CDK Pipelines library effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2

Comments

@emir-demirovic
Copy link

Describe the feature

A support for V2 type for CodePipeline using the aws_cdk.pipelines construct.

Use Case

Since aws_cdk.pipelines supports self-mutation (unlike the aws_cdk.aws_codepipeline, which supports V2 type, but doesn't support the self-mutation feature) and since the V2 type is more cost efficient for our use case with multiple CodePipelines in 1 AWS account, this would help us (and possibly others) a lot.

Proposed Solution

Example usage:

from aws_cdk import pipelines as pipelines

pipeline_name = "example-cdkpipeline"
pipeline = pipelines.CodePipeline(
    self,
    pipeline_name,
    pipeline_name=pipeline_name,
    self_mutation=True,
    synth=synth_step,
    cross_account_keys=True,
    cli_version=CDK_VERSION,
    pipeline_type=pipelines.PipelineType.V2 # feature request
)

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.173.2

Environment details (OS name and version, etc.)

Linux Mint 21 Cinnamon

@emir-demirovic emir-demirovic added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Dec 26, 2024
@github-actions github-actions bot added the @aws-cdk/pipelines CDK Pipelines library label Dec 26, 2024
@khushail khushail added investigating This issue is being investigated and/or work is in progress to resolve the issue. p2 and removed needs-triage This issue or PR still needs to be triaged. labels Dec 26, 2024
@khushail khushail self-assigned this Dec 26, 2024
@khushail
Copy link
Contributor

Hi @emir-demirovic , thanks for reaching out. I see that this aws_cdk.Pipelines is opinionated and it is suggested to use aws_cdk.aws_codepipelines for V2 Support as mentioned in this Readme -https://github.com/aws/aws-cdk/tree/main/packages/aws-cdk-lib/pipelines

Screenshot 2024-12-26 at 11 25 34 AM

I assume your ask is the same, so not really sure if team is going to implement that as its clearly stated in the docs.

However if your ask is different , please feel free to reach back.

@khushail khushail added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. labels Dec 26, 2024
@emir-demirovic
Copy link
Author

Hi @khushail, the issue with the aws_cdk.aws_codepipelines is that it doesn't support the self-mutation feature, that's why we've opted for the aws_cdk.pipelines.

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Dec 27, 2024
@khushail
Copy link
Contributor

@emir-demirovic , I assume you are talking about this property -

https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_codepipeline.Pipeline.html#pipelinetype

Type: [PipelineType](optional, default: PipelineType.V2 if the feature flag CODEPIPELINE_DEFAULT_PIPELINE_TYPE_TO_V2 is true, PipelineType.V1 otherwise)

https://docs.aws.amazon.com/codepipeline/latest/userguide/pipeline-types-planning.html

and your suggestion of property addition would take place here -

https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.pipelines.CodePipeline.html

Marking it as P2 as it won't be immediately addressed by the team but would be on their radar. It would also be open for community contribution.

However I would like to request team's input here as its something they would consider accepting request on or would like to share their insights on this feature's implementation.

@khushail khushail added the effort/small Small work item – less than a day of effort label Dec 27, 2024
@khushail khushail removed their assignment Dec 27, 2024
@BTech-Developer
Copy link

Would love support for codepipelinev2 from this construct.

@salimhamed
Copy link

@khushail Our team has many pipelines implemented using the aws_cdk.pipelines constructs, and we're looking to migrate from PipelineType.V1 to PipelineType.V2. However, since aws_cdk.pipelines does not directly support specifying the PipelineType, we would need to re-implement all our pipelines using aws_cdk.aws_codepipeline.

Adding support for specifying PipelineType within aws_cdk.pipelines would make this migration significantly easier.

I also came across #28694 (comment) in another issue, which suggests that it’s possible to use a PipelineType.V2 pipeline with aws_cdk.pipelines by explicitly creating an aws_cdk.aws_codepipeline.Pipeline and passing it via the codePipeline parameter. Could you confirm if this is the recommended approach?

@emir-demirovic
Copy link
Author

@salimhamed Hi, I've tried that approach, however, for some reason after referencing the newly created pipeline, it tries to re-create it, then the CloudFormation throws out a resource naming conflict (since it tries to create a pipeline with the same name).

@tomburge
Copy link

Hi @emir-demirovic , thanks for reaching out. I see that this aws_cdk.Pipelines is opinionated and it is suggested to use aws_cdk.aws_codepipelines for V2 Support as mentioned in this Readme -https://github.com/aws/aws-cdk/tree/main/packages/aws-cdk-lib/pipelines

Screenshot 2024-12-26 at 11 25 34 AM I assume your ask is the same, so not really sure if team is going to implement that as its clearly stated in the docs.

However if your ask is different , please feel free to reach back.

This is an opinionated library but AWS themselves have stated V2 pipelines are now the default in the console. For CDK Pipelines to have no V2 pipeline support is directly in contradiction to the official stance of AWS as an organization.

This should be added quickly IMO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/pipelines CDK Pipelines library effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2
Projects
None yet
Development

No branches or pull requests

5 participants