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

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:46.835Z") @Stability(Stable) public class S3EventSource extends software.amazon.jsii.JsiiObject implements IEventSource
Use S3 bucket notifications as an event source for AWS Lambda.

Example:

 import software.amazon.awscdk.services.lambda.eventsources.*;
 import software.amazon.awscdk.services.s3.*;
 Function fn;
 Bucket bucket = new Bucket(this, "Bucket");
 fn.addEventSource(S3EventSource.Builder.create(bucket)
         .events(List.of(EventType.OBJECT_CREATED, EventType.OBJECT_REMOVED))
         .filters(List.of(NotificationKeyFilter.builder().prefix("subdir/").build()))
         .build());
 
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    A fluent builder for S3EventSource.

    Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject

    software.amazon.jsii.JsiiObject.InitializationMode

    Nested classes/interfaces inherited from interface software.amazon.awscdk.services.lambda.IEventSource

    IEventSource.Jsii$Default, IEventSource.Jsii$Proxy
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
     
     
    protected
    S3EventSource(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
     
    protected
    S3EventSource(software.amazon.jsii.JsiiObjectRef objRef)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    bind(IFunction target)
    Called by lambda.addEventSource to allow the event source to bind to this function.
     

    Methods inherited from class software.amazon.jsii.JsiiObject

    jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface software.amazon.jsii.JsiiSerializable

    $jsii$toJson
  • Constructor Details

    • S3EventSource

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

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

      @Stability(Stable) public S3EventSource(@NotNull Bucket bucket, @NotNull S3EventSourceProps props)
      Parameters:
      bucket - 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
      Parameters:
      target - This parameter is required.
    • getBucket

      @Stability(Stable) @NotNull public Bucket getBucket()