stream-processing.js
function disableSourceStreamEventSourceMapping(batch, context) {
  const functionName = tracking.getInvokedFunctionNameWithAliasOrVersion(context);

  const batchKey = batch.key;
  const sourceStreamName = (batchKey && batchKey.components && batchKey.components.streamName) ||
    (tracking.getSourceStreamNames(batch.records, context).find(n => isNotBlank(n)));

  if (isBlank(functionName) || isBlank(sourceStreamName)) {
    const errMsg = `FATAL - Cannot disable source stream event source mapping WITHOUT both function (${functionName}) & stream (${sourceStreamName})`;
    context.error(errMsg);
    return Promise.reject(new FatalError(errMsg));
  }

  const avoidEsmCache = context.streamProcessing && context.streamProcessing.avoidEsmCache;

  return esmCache.disableEventSourceMapping(functionName, sourceStreamName, avoidEsmCache, context);
}
function disableSourceStreamEventSourceMapping(batch, context) {
  const functionName = tracking.getInvokedFunctionNameWithAliasOrVersion(context);

  const batchKey = batch.key;
  const sourceStreamName = (batchKey && batchKey.components && batchKey.components.streamName) ||
    (tracking.getSourceStreamNames(batch.records, context).find(n => isNotBlank(n)));

  if (isBlank(functionName) || isBlank(sourceStreamName)) {
    const errMsg = `FATAL - Cannot disable source stream event source mapping WITHOUT both function (${functionName}) & stream (${sourceStreamName})`;
    context.error(errMsg);
    return Promise.reject(new FatalError(errMsg));
  }

  const avoidEsmCache = context.streamProcessing && context.streamProcessing.avoidEsmCache;

  return esmCache.disableEventSourceMapping(functionName, sourceStreamName, avoidEsmCache, context);
}
function disableSourceStreamEventSourceMapping ( batch , context ) { const functionName = tracking . getInvokedFunctionNameWithAliasOrVersion ( context ) ; const batchKey = batch . key ; const sourceStreamName = ( batchKey && batchKey . components && batchKey . components . streamName ) || ( tracking . getSourceStreamNames ( batch . records , context ) . find ( n => isNotBlank ( n ) ) ) ; if ( isBlank ( functionName ) || isBlank ( sourceStreamName ) ) { const errMsg = ` ${ functionName } ${ sourceStreamName } ` ; context . error ( errMsg ) ; return Promise . reject ( new FatalError ( errMsg ) ) ; } const avoidEsmCache = context . streamProcessing && context . streamProcessing . avoidEsmCache ; return esmCache . disableEventSourceMapping ( functionName , sourceStreamName , avoidEsmCache , context ) ; }
Attempts to disable this Lambda's event source mapping to its source stream, which will disable this Lambda's trigger
and prevent it from processing any more messages until the issue is resolved and the trigger is manually re-enabled.
@param {Batch} batch
@param {LambdaAware|StreamConsumerContext} context
@returns {Promise.<*>|*}
Attempts to disable this Lambda s event source mapping to its source stream which will disable this Lambda s trigger and prevent it from processing any more messages until the issue is resolved and the trigger is manually re - enabled .