2

We are creating aws custom resource in a stack using cdk which triggers a lambda. In our case if any failure happens in lambda, it sends a failure signal to custom resource and custom resource trigger auto-rollback to previous version of stack. We want to prevent this case. Our requirement is if the lambda gets failed, custom resource stack just show failure status and don't trigger any rollback deployment.

Is there any way to set disable-rollback property on stack using cdk

priyadhingra19
  • 333
  • 4
  • 15

1 Answers1

5

Yes, the CDK CLI provides the --no-rollback flag just for this purpose:

cdk deploy MyStack --no-rollback

gshpychka
  • 8,523
  • 1
  • 11
  • 31
  • Thanks for the reply here. Do you know any way to do via CDK Typescript ? – priyadhingra19 Dec 14 '22 at 15:59
  • It's a CLI flag, you can't enable it programmatically. Your CDK code is responsible for generating the CloudFormation template - the option to disable rollback is not part of the template. – gshpychka Dec 15 '22 at 10:19