lib/plugins/aws/customResources/resources/s3/lib/bucket.js/removeConfiguration
function removeConfiguration(config) {
  const { functionName, bucketName, region } = config;
  const s3 = new AWS.S3({ region });
  const Bucket = bucketName;

  return getConfiguration(config).then(NotificationConfiguration => {
    // remove configurations for this specific function
    NotificationConfiguration.LambdaFunctionConfigurations = NotificationConfiguration.LambdaFunctionConfigurations.filter(
      conf => !conf.Id.startsWith(functionName)
    );

    const payload = {
      Bucket,
      NotificationConfiguration,
    };
    return s3.putBucketNotificationConfiguration(payload).promise();
  });
}