lib/plugins/aws/customResources/resources/utils.js/handlerWrapper
function handlerWrapper(handler, PhysicalResourceId) {
  return (event, context, callback) => {
    // extend the `event` object to include the PhysicalResourceId
    event = Object.assign({}, event, { PhysicalResourceId });
    return Promise.resolve(handler(event, context, callback))
      .then(
        result => response(event, context, 'SUCCESS', result),
        error => response(event, context, 'FAILED', {}, error)
      )
      .then(result => callback(null, result), callback);
  };
}