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
Yes, the CDK CLI provides the --no-rollback
flag just for this purpose:
cdk deploy MyStack --no-rollback