software.amazon.awscdk.services.lambda.destinations.SnsDestination Maven / Gradle / Ivy
Show all versions of lambda-destinations Show documentation
package software.amazon.awscdk.services.lambda.destinations;
/**
* 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_12_X)
* .handler("index.handler")
* .code(Code.fromAsset(join(__dirname, "lambda-handler")))
* // sns topic for successful invocations
* .onSuccess(new SnsDestination(myTopic))
* .build();
*
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.60.0 (build ebcefe6)", date = "2022-07-13T22:12:01.625Z")
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@software.amazon.jsii.Jsii(module = software.amazon.awscdk.services.lambda.destinations.$Module.class, fqn = "@aws-cdk/aws-lambda-destinations.SnsDestination")
public class SnsDestination extends software.amazon.jsii.JsiiObject implements software.amazon.awscdk.services.lambda.IDestination {
protected SnsDestination(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
}
protected SnsDestination(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
super(initializationMode);
}
/**
* @param topic This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public SnsDestination(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.sns.ITopic topic) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(topic, "topic is required") });
}
/**
* Returns a destination configuration.
*
* @param _scope This parameter is required.
* @param fn This parameter is required.
* @param _options
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.lambda.DestinationConfig bind(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.core.Construct _scope, final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.lambda.IFunction fn, final @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.lambda.DestinationOptions _options) {
return software.amazon.jsii.Kernel.call(this, "bind", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.lambda.DestinationConfig.class), new Object[] { java.util.Objects.requireNonNull(_scope, "_scope is required"), java.util.Objects.requireNonNull(fn, "fn is required"), _options });
}
/**
* Returns a destination configuration.
*
* @param _scope This parameter is required.
* @param fn This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.lambda.DestinationConfig bind(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.core.Construct _scope, final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.lambda.IFunction fn) {
return software.amazon.jsii.Kernel.call(this, "bind", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.lambda.DestinationConfig.class), new Object[] { java.util.Objects.requireNonNull(_scope, "_scope is required"), java.util.Objects.requireNonNull(fn, "fn is required") });
}
}