Class KinesisEventSource

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

@Generated(value="jsii-pacmak/1.96.0 (build 921e240)", date="2024-04-10T22:22:30.105Z") @Stability(Stable) public class KinesisEventSource extends StreamEventSource
Use an Amazon Kinesis stream as an event source for AWS Lambda.

Example:

 import software.amazon.awscdk.services.kinesis.*;
 import software.amazon.awscdk.services.lambda.eventsources.KinesisEventSource;
 Function myFunction;
 Stream stream = new Stream(this, "MyStream");
 myFunction.addEventSource(KinesisEventSource.Builder.create(stream)
         .batchSize(100) // default
         .startingPosition(StartingPosition.TRIM_HORIZON)
         .build());
 
  • Constructor Details

    • KinesisEventSource

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

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

      @Stability(Stable) public KinesisEventSource(@NotNull IStream stream, @NotNull KinesisEventSourceProps props)
      Parameters:
      stream - 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.
    • getStream

      @Stability(Stable) @NotNull public IStream getStream()