aws-cdk icon indicating copy to clipboard operation
aws-cdk copied to clipboard

aws_codepipeline: Rollbacks for CodePipelines

Open jaydm26 opened this issue 1 year ago • 5 comments

Describe the feature

AWS introduced Rollbacks for Stages in CodePipeline. This feature currently seems to be missing in CodePipelines.

https://docs.aws.amazon.com/codepipeline/latest/userguide/stage-rollback.html

Use Case

This feature would allow me to enable automatic rollbacks upon failure directly through CDK instead of manually updating the pipeline to rollback the stage upon failure.

Proposed Solution

# pipeline: codepipeline.Pipeline

pipeline.add_stage(
  placement=None, 
  stage_name, 
  actions=None, 
  transition_disabled_reason=None, 
  transition_to_enabled=None,
  auto_rollback = True # Boolean that determines if the stage should be rolled back upon failure
)

I think there needs to be changes in the L1 object as well, but I am not well-versed with CDK to know the exact changes.

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.140.0

Environment details (OS name and version, etc.)

MacOS Sonoma 14.4.1, Python 3.11.7

jaydm26 avatar May 07 '24 07:05 jaydm26

I would like to address this issue.

However, the CodePipeline API has this feature, but CloudFormation does not yet. So we are waiting for the CloudFormation property. (However, the user guide already describes the feature on CloudFormation...)

go-to-k avatar May 07 '24 08:05 go-to-k

Do we have a timeline on by when CloudFormation will be updated? Otherwise, I am happy to raise an issue with https://github.com/cdklabs/awscdk-service-spec

jaydm26 avatar May 07 '24 08:05 jaydm26

Hi @jaydm26 ,thanks for requesting this feature. As correctly mentioned by @go-to-k , this is not currently provided by cloudformation. However you could add this feature to Cloudformation coverage roadmap and help in prioritizing this by upvotes.

khushail avatar May 07 '24 19:05 khushail

The property (OnFailure) appears to have been added to CloudFormation and to L1. I will start on my PR.

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codepipeline-pipeline-stagedeclaration.html

https://github.com/aws/aws-cdk/pull/30182

go-to-k avatar Jun 02 '24 15:06 go-to-k

Can we please have an update on this feature? The PR looks to be abandoned.

tvdijk avatar Oct 16 '24 21:10 tvdijk

Any updates on this?

regmicmahesh avatar Oct 24 '24 12:10 regmicmahesh

The PR got abandoned (rolled back) with the comment that we should work on a V2 Pipeline Construct.

https://github.com/aws/aws-cdk/pull/30465#issuecomment-2153270981

However I can't see any public progress or initiative on this. I believe we could start working on that by opening an issue and bundling all related issues there?

jaecktec avatar Feb 17 '25 14:02 jaecktec