software.amazon.awscdk.services.lambda.destinations.SqsDestination Maven / Gradle / Ivy
Show all versions of lambda-destinations Show documentation
package software.amazon.awscdk.services.lambda.destinations;
/**
* Use a SQS queue as a Lambda destination.
*
* Example:
*
*
* // An sqs queue for unsuccessful invocations of a lambda function
* import software.amazon.awscdk.services.sqs.*;
* Queue deadLetterQueue = new Queue(this, "DeadLetterQueue");
* Function myFn = Function.Builder.create(this, "Fn")
* .runtime(Runtime.NODEJS_12_X)
* .handler("index.handler")
* .code(Code.fromInline("// your code"))
* // sqs queue for unsuccessful invocations
* .onFailure(new SqsDestination(deadLetterQueue))
* .build();
*
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.60.0 (build ebcefe6)", date = "2022-07-13T22:12:01.626Z")
@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.SqsDestination")
public class SqsDestination extends software.amazon.jsii.JsiiObject implements software.amazon.awscdk.services.lambda.IDestination {
protected SqsDestination(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
}
protected SqsDestination(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
super(initializationMode);
}
/**
* @param queue This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public SqsDestination(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.sqs.IQueue queue) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(queue, "queue 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") });
}
}