in custom-resource/dms_task_conf/task.py [0:0]
def delete(event, context):
logger.info("Got Delete")
properties = event.get("ResourceProperties", None)
replication_task_arn = properties.get("ReplicationTaskArn")
if _describe(replication_task_arn) == "running":
client.stop_replication_task(ReplicationTaskArn=replication_task_arn)