This delete can be removed, because CloudFormation will call the custom resource with a delete event if the physical resource id changes. Calling the put() method will do that.
Removing the delete will also make sure the delete is only triggered when the stack is in UPDATE_COMPLETE_CLEANUP_IN_PROGRESS. Making sure that no data is deleted if a Rollback happens.
The update method at https://github.com/iRobotCorporation/cfn-custom-resource/blob/master/examples/S3Object.py#L83 checks of the bucket or path changes, and triggers a delete if this happens.
This delete can be removed, because CloudFormation will call the custom resource with a delete event if the physical resource id changes. Calling the put() method will do that.
Removing the delete will also make sure the delete is only triggered when the stack is in UPDATE_COMPLETE_CLEANUP_IN_PROGRESS. Making sure that no data is deleted if a Rollback happens.