-
Hello, Consider the following: step1: pipelines.Step
step2: pipelines.Step
step3: pipelines.Step What is the correct way to say that pipelines.Step.sequence([step1, step2, step3]) or step2.add_step_dependency(step1)
step3.add_step_dependency(step2) I wish to know which of the two is the right way to go about defining dependencies between steps and if there are any differences that I may not be aware of. Link to the Documentation: https://docs.aws.amazon.com/cdk/api/v2/python/aws_cdk.pipelines/Step.html Thank you in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
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
From my point of view better to use linear sequence approach Good luck bro |
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
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 onestep2.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 sequencesFrom my point of view…