Class DynamoEventSource

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.lambda.eventsources.StreamEventSource
software.amazon.awscdk.services.lambda.eventsources.DynamoEventSource
All Implemented Interfaces:
IEventSource, software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.98.0 (build 00b106d)", date="2024-05-08T21:35:09.319Z") @Stability(Stable) public class DynamoEventSource extends StreamEventSource
Use an Amazon DynamoDB stream as an event source for AWS Lambda.

Example:

 import software.amazon.awscdk.services.lambda.eventsources.*;
 import software.amazon.awscdk.services.dynamodb.*;
 Function fn;
 Table table = Table.Builder.create(this, "Table")
         .partitionKey(Attribute.builder()
                 .name("id")
                 .type(AttributeType.STRING)
                 .build())
         .stream(StreamViewType.NEW_IMAGE)
         .build();
 fn.addEventSource(DynamoEventSource.Builder.create(table)
         .startingPosition(StartingPosition.LATEST)
         .filters(List.of(FilterCriteria.filter(Map.of("eventName", FilterRule.isEqual("INSERT")))))
         .build());
 
  • Constructor Details

    • DynamoEventSource

      protected DynamoEventSource(software.amazon.jsii.JsiiObjectRef objRef)
    • DynamoEventSource

      protected DynamoEventSource(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • DynamoEventSource

      @Stability(Stable) public DynamoEventSource(@NotNull ITable table, @NotNull DynamoEventSourceProps props)
      Parameters:
      table - This parameter is required.
      props - This parameter is required.
  • Method Details

    • bind

      @Stability(Stable) public void bind(@NotNull IFunction target)
      Called by lambda.addEventSource to allow the event source to bind to this function.

      Specified by:
      bind in interface IEventSource
      Specified by:
      bind in class StreamEventSource
      Parameters:
      target - This parameter is required.
    • getEventSourceMappingArn

      @Stability(Stable) @NotNull public String getEventSourceMappingArn()
      The ARN for this EventSourceMapping.
    • getEventSourceMappingId

      @Stability(Stable) @NotNull public String getEventSourceMappingId()
      The identifier for this EventSourceMapping.