-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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-lib/pipelines): CDKPipelines source / input change from v1 to v2 doesn't allow 5 sources #27359
Comments
Hi, thanks for this feedback. Can you please elaborate on which v1 version you were? I suspect that the change you are hitting is not related to CDk v1 vs v2 but the GA of CDKPipelines as this changed the interface compared to the alpha. The class CDKPipeline does not exist anymore but is CodePipeline. This is a different API. |
Previous version was CDK 1.116.0 |
Indeed this appears to be a regression in an L2 construct: The underlying CloudFormation has no documented maximums: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codepipeline-pipeline-stages.html |
@natalie-white-aws Thanks for the info. That was exactly the version where CDK pipelines went GA. Did you use the class CodePipeline (https://github.com/aws/aws-cdk/blob/v1-main/packages/%40aws-cdk/pipelines/lib/codepipeline/codepipeline.ts#L282) or the legacy CdkPipeline class (https://github.com/aws/aws-cdk/blob/v1-main/packages/%40aws-cdk/pipelines/lib/legacy/pipeline.ts#L215). The latter was never meant to be GA and was kept for compatibility but officially deprecated in 1.129.0 |
I cannot follow? CDK pipelines is not an L2 but an L3 construct, not to be confused with the CodePipeline L2 in the aws-codepipeline namespace. |
@natalie-white-aws Could you please elaborate on a few things?
|
What versions of what libraries are you using? We advise that teams migrating from a very old version of CDKv1 perform two migrations: First to the last supported version of CDKv1, then to the current CDKv2. Have you performed this double-migration yet? What exactly are you attempting to accomplish? |
The CodeBuild additional inputs limit is documented in CodePipeline even though the limit for Secondary Sources in CodeBuild is 12. I think the primary reason the limit isn't enforce in CloudFormation is because the Action is abstracted to cover all action types, and each type has its own limits. The issue isn't that CloudFormation isn't enforcing the service limit, it's that the way CDKPipelines handles inputs changed from a Source Stage with multiple Actions (which is only limited by the number of actions in a stage) to a Build action, which does have this limit. |
Describe the bug
Multiple teams have reported that migrating from CDK v1 to v2 when using CDKPipelines results in no longer being able to use 5 sources for CodeBuild. The symptom is that at synth time, they get a "Build/CodeBuild cannot have more than 5 input artifacts" error from the core CodeBuild service, which is a hard limit.
The approach of using additional_inputs for multiple sources is suggested in this GitHub issue:
#14493
but it's not quite what was previously allowed with the Source add action functionality.
Expected Behavior
Minimal changes to the CDKPipeline in the v1 to v2 upgrade, or prescriptive guidance of how to do so for pipelines that have more than one input.
Current Behavior
After upgrading to CDK v2 and attempting to configure the same multi-source Source actions via the CodeBuild additional_inputs list, the symptom is that at synth time, they get a "Build/CodeBuild cannot have more than 5 input artifacts" error from the core CodeBuild service, which is a hard limit.
Reproduction Steps
Steps to reproduce:
Possible Solution
I think this may be due to the removal of the Source stage entirely in the move to v2, subsequent confusion between ShellSteps and CodeBuild steps, and the lack of documentation / examples for / validation that a CodeBuild step can't have more than 5 inputs (because the CodeBuild service itself has that hard limit.
My requested changes would be to
What #3 looks like depends on whether If #1 is possible. If #1 is not possible, is our prescriptive guidance to configure one or more ShellSteps before the CodeBuild step to accumulate inputs first, then build?
Either way, we can still do #2 and #3 to improve the developer experience. Thanks!
Additional Information/Context
Need to ensure that whatever change is made whether the pipeline can be triggered by a change in any of the multiple inputs, rather than just the one specified in the required input parameter.
CDK CLI Version
2.93.0
Framework Version
No response
Node.js Version
16.20.0
OS
Linux
Language
Python
Language Version
Python version 3.9.16
Other information
No response
The text was updated successfully, but these errors were encountered: