java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.lambda.destinations.SnsDestination
All Implemented Interfaces:
IDestination, software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.104.0 (build e79254c)", date="2024-11-22T02:24:03.992Z") @Stability(Stable) public class SnsDestination extends software.amazon.jsii.JsiiObject implements IDestination
Use a SNS topic as a Lambda destination.

Example:

 // An sns topic for successful invocations of a lambda function
 import software.amazon.awscdk.services.sns.*;
 Topic myTopic = new Topic(this, "Topic");
 Function myFn = Function.Builder.create(this, "Fn")
         .runtime(Runtime.NODEJS_LATEST)
         .handler("index.handler")
         .code(Code.fromAsset(join(__dirname, "lambda-handler")))
         // sns topic for successful invocations
         .onSuccess(new SnsDestination(myTopic))
         .build();
 
  • Nested Class Summary

    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.IDestination

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

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

    Modifier and Type
    Method
    Description
    bind(software.constructs.Construct _scope, IFunction fn)
    Returns a destination configuration.
    bind(software.constructs.Construct _scope, IFunction fn, DestinationOptions _options)
    Returns a destination configuration.

    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

    • SnsDestination

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

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

      @Stability(Stable) public SnsDestination(@NotNull ITopic topic)
      Parameters:
      topic - This parameter is required.
  • Method Details

    • bind

      @Stability(Stable) @NotNull public DestinationConfig bind(@NotNull software.constructs.Construct _scope, @NotNull IFunction fn, @Nullable DestinationOptions _options)
      Returns a destination configuration.

      Specified by:
      bind in interface IDestination
      Parameters:
      _scope - This parameter is required.
      fn - This parameter is required.
      _options -
    • bind

      @Stability(Stable) @NotNull public DestinationConfig bind(@NotNull software.constructs.Construct _scope, @NotNull IFunction fn)
      Returns a destination configuration.

      Specified by:
      bind in interface IDestination
      Parameters:
      _scope - This parameter is required.
      fn - This parameter is required.