AWS Systems Manager Automation now lets you define the actions to perform when an operator cancels the execution of a runbook. Using this feature, you can automatically roll back any changes or perform necessary cleanups when the execution of a runbook is canceled.
Source:: Amazon AWS