Jump to Content

This API Documentation is now deprecated

We are excited to announce our new API Documentation.

Class UpdateEventSourceMappingCommandProtected

Updates an event source mapping. You can change the function that Lambda invokes, or pause invocation and resume later from the same location.

For details about how to configure different event sources, see the following topics.

The following error handling options are available only for stream sources (DynamoDB and Kinesis):

  • BisectBatchOnFunctionError – If the function returns an error, split the batch in two and retry.

  • DestinationConfig – Send discarded records to an Amazon SQS queue or Amazon SNS topic.

  • MaximumRecordAgeInSeconds – Discard records older than the specified age. The default value is infinite (-1). When set to infinite (-1), failed records are retried until the record expires

  • MaximumRetryAttempts – Discard records after the specified number of retries. The default value is infinite (-1). When set to infinite (-1), failed records are retried until the record expires.

  • ParallelizationFactor – Process multiple batches from each shard concurrently.

For information about which configuration parameters apply to each event source, see the following topics.

Example

Use a bare-bones client and the command you need to make an API call.

import { LambdaClient, UpdateEventSourceMappingCommand } from "@aws-sdk/client-lambda"; // ES Modules import
// const { LambdaClient, UpdateEventSourceMappingCommand } = require("@aws-sdk/client-lambda"); // CommonJS import
const client = new LambdaClient(config);
const input = { // UpdateEventSourceMappingRequest
UUID: "STRING_VALUE", // required
FunctionName: "STRING_VALUE",
Enabled: true || false,
BatchSize: Number("int"),
FilterCriteria: { // FilterCriteria
Filters: [ // FilterList
{ // Filter
Pattern: "STRING_VALUE",
},
],
},
MaximumBatchingWindowInSeconds: Number("int"),
DestinationConfig: { // DestinationConfig
OnSuccess: { // OnSuccess
Destination: "STRING_VALUE",
},
OnFailure: { // OnFailure
Destination: "STRING_VALUE",
},
},
MaximumRecordAgeInSeconds: Number("int"),
BisectBatchOnFunctionError: true || false,
MaximumRetryAttempts: Number("int"),
ParallelizationFactor: Number("int"),
SourceAccessConfigurations: [ // SourceAccessConfigurations
{ // SourceAccessConfiguration
Type: "BASIC_AUTH" || "VPC_SUBNET" || "VPC_SECURITY_GROUP" || "SASL_SCRAM_512_AUTH" || "SASL_SCRAM_256_AUTH" || "VIRTUAL_HOST" || "CLIENT_CERTIFICATE_TLS_AUTH" || "SERVER_ROOT_CA_CERTIFICATE",
URI: "STRING_VALUE",
},
],
TumblingWindowInSeconds: Number("int"),
FunctionResponseTypes: [ // FunctionResponseTypeList
"ReportBatchItemFailures",
],
ScalingConfig: { // ScalingConfig
MaximumConcurrency: Number("int"),
},
DocumentDBEventSourceConfig: { // DocumentDBEventSourceConfig
DatabaseName: "STRING_VALUE",
CollectionName: "STRING_VALUE",
FullDocument: "UpdateLookup" || "Default",
},
};
const command = new UpdateEventSourceMappingCommand(input);
const response = await client.send(command);
// { // EventSourceMappingConfiguration
// UUID: "STRING_VALUE",
// StartingPosition: "TRIM_HORIZON" || "LATEST" || "AT_TIMESTAMP",
// StartingPositionTimestamp: new Date("TIMESTAMP"),
// BatchSize: Number("int"),
// MaximumBatchingWindowInSeconds: Number("int"),
// ParallelizationFactor: Number("int"),
// EventSourceArn: "STRING_VALUE",
// FilterCriteria: { // FilterCriteria
// Filters: [ // FilterList
// { // Filter
// Pattern: "STRING_VALUE",
// },
// ],
// },
// FunctionArn: "STRING_VALUE",
// LastModified: new Date("TIMESTAMP"),
// LastProcessingResult: "STRING_VALUE",
// State: "STRING_VALUE",
// StateTransitionReason: "STRING_VALUE",
// DestinationConfig: { // DestinationConfig
// OnSuccess: { // OnSuccess
// Destination: "STRING_VALUE",
// },
// OnFailure: { // OnFailure
// Destination: "STRING_VALUE",
// },
// },
// Topics: [ // Topics
// "STRING_VALUE",
// ],
// Queues: [ // Queues
// "STRING_VALUE",
// ],
// SourceAccessConfigurations: [ // SourceAccessConfigurations
// { // SourceAccessConfiguration
// Type: "BASIC_AUTH" || "VPC_SUBNET" || "VPC_SECURITY_GROUP" || "SASL_SCRAM_512_AUTH" || "SASL_SCRAM_256_AUTH" || "VIRTUAL_HOST" || "CLIENT_CERTIFICATE_TLS_AUTH" || "SERVER_ROOT_CA_CERTIFICATE",
// URI: "STRING_VALUE",
// },
// ],
// SelfManagedEventSource: { // SelfManagedEventSource
// Endpoints: { // Endpoints
// "<keys>": [ // EndpointLists
// "STRING_VALUE",
// ],
// },
// },
// MaximumRecordAgeInSeconds: Number("int"),
// BisectBatchOnFunctionError: true || false,
// MaximumRetryAttempts: Number("int"),
// TumblingWindowInSeconds: Number("int"),
// FunctionResponseTypes: [ // FunctionResponseTypeList
// "ReportBatchItemFailures",
// ],
// AmazonManagedKafkaEventSourceConfig: { // AmazonManagedKafkaEventSourceConfig
// ConsumerGroupId: "STRING_VALUE",
// },
// SelfManagedKafkaEventSourceConfig: { // SelfManagedKafkaEventSourceConfig
// ConsumerGroupId: "STRING_VALUE",
// },
// ScalingConfig: { // ScalingConfig
// MaximumConcurrency: Number("int"),
// },
// DocumentDBEventSourceConfig: { // DocumentDBEventSourceConfig
// DatabaseName: "STRING_VALUE",
// CollectionName: "STRING_VALUE",
// FullDocument: "UpdateLookup" || "Default",
// },
// };

Param

UpdateEventSourceMappingCommandInput

Returns

UpdateEventSourceMappingCommandOutput

See

Throws

InvalidParameterValueException (client fault)

One of the parameters in the request is not valid.

Throws

ResourceConflictException (client fault)

The resource already exists, or another operation is in progress.

Throws

ResourceInUseException (client fault)

The operation conflicts with the resource's availability. For example, you tried to update an event source mapping in the CREATING state, or you tried to delete an event source mapping currently UPDATING.

Throws

ResourceNotFoundException (client fault)

The resource specified in the request does not exist.

Throws

ServiceException (server fault)

The Lambda service encountered an internal error.

Throws

TooManyRequestsException (client fault)

The request throughput limit was exceeded. For more information, see Lambda quotas.

Throws

LambdaServiceException

Base exception class for all service exceptions from Lambda service.

Hierarchy

Constructors

Properties

Methods

Constructors

Properties

Methods