Skip to content

What is the correct way to add dependencies between steps in the CDK Pipelines? #30839

Answered by VyvaHart
jaydm26 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @jaydm26

These two methods define dependencies between steps in a pipeline, but.. each of them have own pros and cons, which depends on your workflow

  • pipelines.Step.sequence([step1, step2, step3]): easier to understand and read. Script looks more 'clean', but it is not good approach for complex dependency graphs (branches or conditional dependencies..), because in this case you are using a linear sequence of steps where each step depends on the previous one

  • step2.add_step_dependency(step1) step3.add_step_dependency(step2): more flexible and easy to debug, but.. requires more code to define the dependencies, which can be cumbersome for simple linear sequences

From my point of view…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by jaydm26
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants