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.84.0 (build 5404dcf)", date="2023-06-19T16:30:48.823Z") @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_14_X)
         .handler("index.handler")
         .code(Code.fromAsset(join(__dirname, "lambda-handler")))
         // sns topic for successful invocations
         .onSuccess(new SnsDestination(myTopic))
         .build();
 
  • 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 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 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.