All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awsconstructs.services.sqslambda.SqsToLambdaProps Maven / Gradle / Ivy

Go to download

CDK constructs for defining an interaction between an Amazon SQS queue and an AWS Lambda function.

There is a newer version: 2.74.0
Show newest version
package software.amazon.awsconstructs.services.sqslambda;

/**
 */
@javax.annotation.Generated(value = "jsii-pacmak/1.106.0 (build e852934)", date = "2024-12-24T18:32:46.346Z")
@software.amazon.jsii.Jsii(module = software.amazon.awsconstructs.services.sqslambda.$Module.class, fqn = "@aws-solutions-constructs/aws-sqs-lambda.SqsToLambdaProps")
@software.amazon.jsii.Jsii.Proxy(SqsToLambdaProps.Jsii$Proxy.class)
public interface SqsToLambdaProps extends software.amazon.jsii.JsiiSerializable {

    /**
     * Optional user provided properties for the dead letter queue.
     * 

* Default: - Default props are used */ default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.sqs.QueueProps getDeadLetterQueueProps() { return null; } /** * Whether to deploy a secondary queue to be used as a dead letter queue. *

* Default: - true. */ default @org.jetbrains.annotations.Nullable java.lang.Boolean getDeployDeadLetterQueue() { return null; } /** * If no key is provided, this flag determines whether the queue is encrypted with a new CMK or an AWS managed key. *

* This flag is ignored if any of the following are defined: queueProps.encryptionMasterKey, encryptionKey or encryptionKeyProps. *

* Default: - False if queueProps.encryptionMasterKey, encryptionKey, and encryptionKeyProps are all undefined. */ default @org.jetbrains.annotations.Nullable java.lang.Boolean getEnableEncryptionWithCustomerManagedKey() { return null; } /** * An optional, imported encryption key to encrypt the SQS queue with. *

* Default: - None */ default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.kms.Key getEncryptionKey() { return null; } /** * Optional user provided properties to override the default properties for the KMS encryption key used to encrypt the SQS queue with. *

* Default: - None */ default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.kms.KeyProps getEncryptionKeyProps() { return null; } /** * Existing instance of Lambda Function object, providing both this and lambdaFunctionProps will cause an error. *

* Default: - None */ default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.lambda.Function getExistingLambdaObj() { return null; } /** * Existing instance of SQS queue object, Providing both this and queueProps will cause an error. *

* Default: - Default props are used */ default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.sqs.Queue getExistingQueueObj() { return null; } /** * User provided props to override the default props for the Lambda function. *

* Default: - Default properties are used. */ default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.lambda.FunctionProps getLambdaFunctionProps() { return null; } /** * The number of times a message can be unsuccessfully dequeued before being moved to the dead-letter queue. *

* Default: - required field if deployDeadLetterQueue=true. */ default @org.jetbrains.annotations.Nullable java.lang.Number getMaxReceiveCount() { return null; } /** * Optional user provided properties. *

* Default: - Default props are used */ default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.sqs.QueueProps getQueueProps() { return null; } /** * Optional user provided properties for the queue event source. *

* Default: - Default props are used */ default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.lambda.eventsources.SqsEventSourceProps getSqsEventSourceProps() { return null; } /** * @return a {@link Builder} of {@link SqsToLambdaProps} */ static Builder builder() { return new Builder(); } /** * A builder for {@link SqsToLambdaProps} */ public static final class Builder implements software.amazon.jsii.Builder { software.amazon.awscdk.services.sqs.QueueProps deadLetterQueueProps; java.lang.Boolean deployDeadLetterQueue; java.lang.Boolean enableEncryptionWithCustomerManagedKey; software.amazon.awscdk.services.kms.Key encryptionKey; software.amazon.awscdk.services.kms.KeyProps encryptionKeyProps; software.amazon.awscdk.services.lambda.Function existingLambdaObj; software.amazon.awscdk.services.sqs.Queue existingQueueObj; software.amazon.awscdk.services.lambda.FunctionProps lambdaFunctionProps; java.lang.Number maxReceiveCount; software.amazon.awscdk.services.sqs.QueueProps queueProps; software.amazon.awscdk.services.lambda.eventsources.SqsEventSourceProps sqsEventSourceProps; /** * Sets the value of {@link SqsToLambdaProps#getDeadLetterQueueProps} * @param deadLetterQueueProps Optional user provided properties for the dead letter queue. * @return {@code this} */ public Builder deadLetterQueueProps(software.amazon.awscdk.services.sqs.QueueProps deadLetterQueueProps) { this.deadLetterQueueProps = deadLetterQueueProps; return this; } /** * Sets the value of {@link SqsToLambdaProps#getDeployDeadLetterQueue} * @param deployDeadLetterQueue Whether to deploy a secondary queue to be used as a dead letter queue. * @return {@code this} */ public Builder deployDeadLetterQueue(java.lang.Boolean deployDeadLetterQueue) { this.deployDeadLetterQueue = deployDeadLetterQueue; return this; } /** * Sets the value of {@link SqsToLambdaProps#getEnableEncryptionWithCustomerManagedKey} * @param enableEncryptionWithCustomerManagedKey If no key is provided, this flag determines whether the queue is encrypted with a new CMK or an AWS managed key. * This flag is ignored if any of the following are defined: queueProps.encryptionMasterKey, encryptionKey or encryptionKeyProps. * @return {@code this} */ public Builder enableEncryptionWithCustomerManagedKey(java.lang.Boolean enableEncryptionWithCustomerManagedKey) { this.enableEncryptionWithCustomerManagedKey = enableEncryptionWithCustomerManagedKey; return this; } /** * Sets the value of {@link SqsToLambdaProps#getEncryptionKey} * @param encryptionKey An optional, imported encryption key to encrypt the SQS queue with. * @return {@code this} */ public Builder encryptionKey(software.amazon.awscdk.services.kms.Key encryptionKey) { this.encryptionKey = encryptionKey; return this; } /** * Sets the value of {@link SqsToLambdaProps#getEncryptionKeyProps} * @param encryptionKeyProps Optional user provided properties to override the default properties for the KMS encryption key used to encrypt the SQS queue with. * @return {@code this} */ public Builder encryptionKeyProps(software.amazon.awscdk.services.kms.KeyProps encryptionKeyProps) { this.encryptionKeyProps = encryptionKeyProps; return this; } /** * Sets the value of {@link SqsToLambdaProps#getExistingLambdaObj} * @param existingLambdaObj Existing instance of Lambda Function object, providing both this and lambdaFunctionProps will cause an error. * @return {@code this} */ public Builder existingLambdaObj(software.amazon.awscdk.services.lambda.Function existingLambdaObj) { this.existingLambdaObj = existingLambdaObj; return this; } /** * Sets the value of {@link SqsToLambdaProps#getExistingQueueObj} * @param existingQueueObj Existing instance of SQS queue object, Providing both this and queueProps will cause an error. * @return {@code this} */ public Builder existingQueueObj(software.amazon.awscdk.services.sqs.Queue existingQueueObj) { this.existingQueueObj = existingQueueObj; return this; } /** * Sets the value of {@link SqsToLambdaProps#getLambdaFunctionProps} * @param lambdaFunctionProps User provided props to override the default props for the Lambda function. * @return {@code this} */ public Builder lambdaFunctionProps(software.amazon.awscdk.services.lambda.FunctionProps lambdaFunctionProps) { this.lambdaFunctionProps = lambdaFunctionProps; return this; } /** * Sets the value of {@link SqsToLambdaProps#getMaxReceiveCount} * @param maxReceiveCount The number of times a message can be unsuccessfully dequeued before being moved to the dead-letter queue. * @return {@code this} */ public Builder maxReceiveCount(java.lang.Number maxReceiveCount) { this.maxReceiveCount = maxReceiveCount; return this; } /** * Sets the value of {@link SqsToLambdaProps#getQueueProps} * @param queueProps Optional user provided properties. * @return {@code this} */ public Builder queueProps(software.amazon.awscdk.services.sqs.QueueProps queueProps) { this.queueProps = queueProps; return this; } /** * Sets the value of {@link SqsToLambdaProps#getSqsEventSourceProps} * @param sqsEventSourceProps Optional user provided properties for the queue event source. * @return {@code this} */ public Builder sqsEventSourceProps(software.amazon.awscdk.services.lambda.eventsources.SqsEventSourceProps sqsEventSourceProps) { this.sqsEventSourceProps = sqsEventSourceProps; return this; } /** * Builds the configured instance. * @return a new instance of {@link SqsToLambdaProps} * @throws NullPointerException if any required attribute was not provided */ @Override public SqsToLambdaProps build() { return new Jsii$Proxy(this); } } /** * An implementation for {@link SqsToLambdaProps} */ @software.amazon.jsii.Internal final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements SqsToLambdaProps { private final software.amazon.awscdk.services.sqs.QueueProps deadLetterQueueProps; private final java.lang.Boolean deployDeadLetterQueue; private final java.lang.Boolean enableEncryptionWithCustomerManagedKey; private final software.amazon.awscdk.services.kms.Key encryptionKey; private final software.amazon.awscdk.services.kms.KeyProps encryptionKeyProps; private final software.amazon.awscdk.services.lambda.Function existingLambdaObj; private final software.amazon.awscdk.services.sqs.Queue existingQueueObj; private final software.amazon.awscdk.services.lambda.FunctionProps lambdaFunctionProps; private final java.lang.Number maxReceiveCount; private final software.amazon.awscdk.services.sqs.QueueProps queueProps; private final software.amazon.awscdk.services.lambda.eventsources.SqsEventSourceProps sqsEventSourceProps; /** * Constructor that initializes the object based on values retrieved from the JsiiObject. * @param objRef Reference to the JSII managed object. */ protected Jsii$Proxy(final software.amazon.jsii.JsiiObjectRef objRef) { super(objRef); this.deadLetterQueueProps = software.amazon.jsii.Kernel.get(this, "deadLetterQueueProps", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.sqs.QueueProps.class)); this.deployDeadLetterQueue = software.amazon.jsii.Kernel.get(this, "deployDeadLetterQueue", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class)); this.enableEncryptionWithCustomerManagedKey = software.amazon.jsii.Kernel.get(this, "enableEncryptionWithCustomerManagedKey", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class)); this.encryptionKey = software.amazon.jsii.Kernel.get(this, "encryptionKey", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.kms.Key.class)); this.encryptionKeyProps = software.amazon.jsii.Kernel.get(this, "encryptionKeyProps", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.kms.KeyProps.class)); this.existingLambdaObj = software.amazon.jsii.Kernel.get(this, "existingLambdaObj", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.lambda.Function.class)); this.existingQueueObj = software.amazon.jsii.Kernel.get(this, "existingQueueObj", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.sqs.Queue.class)); this.lambdaFunctionProps = software.amazon.jsii.Kernel.get(this, "lambdaFunctionProps", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.lambda.FunctionProps.class)); this.maxReceiveCount = software.amazon.jsii.Kernel.get(this, "maxReceiveCount", software.amazon.jsii.NativeType.forClass(java.lang.Number.class)); this.queueProps = software.amazon.jsii.Kernel.get(this, "queueProps", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.sqs.QueueProps.class)); this.sqsEventSourceProps = software.amazon.jsii.Kernel.get(this, "sqsEventSourceProps", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.lambda.eventsources.SqsEventSourceProps.class)); } /** * Constructor that initializes the object based on literal property values passed by the {@link Builder}. */ protected Jsii$Proxy(final Builder builder) { super(software.amazon.jsii.JsiiObject.InitializationMode.JSII); this.deadLetterQueueProps = builder.deadLetterQueueProps; this.deployDeadLetterQueue = builder.deployDeadLetterQueue; this.enableEncryptionWithCustomerManagedKey = builder.enableEncryptionWithCustomerManagedKey; this.encryptionKey = builder.encryptionKey; this.encryptionKeyProps = builder.encryptionKeyProps; this.existingLambdaObj = builder.existingLambdaObj; this.existingQueueObj = builder.existingQueueObj; this.lambdaFunctionProps = builder.lambdaFunctionProps; this.maxReceiveCount = builder.maxReceiveCount; this.queueProps = builder.queueProps; this.sqsEventSourceProps = builder.sqsEventSourceProps; } @Override public final software.amazon.awscdk.services.sqs.QueueProps getDeadLetterQueueProps() { return this.deadLetterQueueProps; } @Override public final java.lang.Boolean getDeployDeadLetterQueue() { return this.deployDeadLetterQueue; } @Override public final java.lang.Boolean getEnableEncryptionWithCustomerManagedKey() { return this.enableEncryptionWithCustomerManagedKey; } @Override public final software.amazon.awscdk.services.kms.Key getEncryptionKey() { return this.encryptionKey; } @Override public final software.amazon.awscdk.services.kms.KeyProps getEncryptionKeyProps() { return this.encryptionKeyProps; } @Override public final software.amazon.awscdk.services.lambda.Function getExistingLambdaObj() { return this.existingLambdaObj; } @Override public final software.amazon.awscdk.services.sqs.Queue getExistingQueueObj() { return this.existingQueueObj; } @Override public final software.amazon.awscdk.services.lambda.FunctionProps getLambdaFunctionProps() { return this.lambdaFunctionProps; } @Override public final java.lang.Number getMaxReceiveCount() { return this.maxReceiveCount; } @Override public final software.amazon.awscdk.services.sqs.QueueProps getQueueProps() { return this.queueProps; } @Override public final software.amazon.awscdk.services.lambda.eventsources.SqsEventSourceProps getSqsEventSourceProps() { return this.sqsEventSourceProps; } @Override @software.amazon.jsii.Internal public com.fasterxml.jackson.databind.JsonNode $jsii$toJson() { final com.fasterxml.jackson.databind.ObjectMapper om = software.amazon.jsii.JsiiObjectMapper.INSTANCE; final com.fasterxml.jackson.databind.node.ObjectNode data = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode(); if (this.getDeadLetterQueueProps() != null) { data.set("deadLetterQueueProps", om.valueToTree(this.getDeadLetterQueueProps())); } if (this.getDeployDeadLetterQueue() != null) { data.set("deployDeadLetterQueue", om.valueToTree(this.getDeployDeadLetterQueue())); } if (this.getEnableEncryptionWithCustomerManagedKey() != null) { data.set("enableEncryptionWithCustomerManagedKey", om.valueToTree(this.getEnableEncryptionWithCustomerManagedKey())); } if (this.getEncryptionKey() != null) { data.set("encryptionKey", om.valueToTree(this.getEncryptionKey())); } if (this.getEncryptionKeyProps() != null) { data.set("encryptionKeyProps", om.valueToTree(this.getEncryptionKeyProps())); } if (this.getExistingLambdaObj() != null) { data.set("existingLambdaObj", om.valueToTree(this.getExistingLambdaObj())); } if (this.getExistingQueueObj() != null) { data.set("existingQueueObj", om.valueToTree(this.getExistingQueueObj())); } if (this.getLambdaFunctionProps() != null) { data.set("lambdaFunctionProps", om.valueToTree(this.getLambdaFunctionProps())); } if (this.getMaxReceiveCount() != null) { data.set("maxReceiveCount", om.valueToTree(this.getMaxReceiveCount())); } if (this.getQueueProps() != null) { data.set("queueProps", om.valueToTree(this.getQueueProps())); } if (this.getSqsEventSourceProps() != null) { data.set("sqsEventSourceProps", om.valueToTree(this.getSqsEventSourceProps())); } final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode(); struct.set("fqn", om.valueToTree("@aws-solutions-constructs/aws-sqs-lambda.SqsToLambdaProps")); struct.set("data", data); final com.fasterxml.jackson.databind.node.ObjectNode obj = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode(); obj.set("$jsii.struct", struct); return obj; } @Override public final boolean equals(final Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; SqsToLambdaProps.Jsii$Proxy that = (SqsToLambdaProps.Jsii$Proxy) o; if (this.deadLetterQueueProps != null ? !this.deadLetterQueueProps.equals(that.deadLetterQueueProps) : that.deadLetterQueueProps != null) return false; if (this.deployDeadLetterQueue != null ? !this.deployDeadLetterQueue.equals(that.deployDeadLetterQueue) : that.deployDeadLetterQueue != null) return false; if (this.enableEncryptionWithCustomerManagedKey != null ? !this.enableEncryptionWithCustomerManagedKey.equals(that.enableEncryptionWithCustomerManagedKey) : that.enableEncryptionWithCustomerManagedKey != null) return false; if (this.encryptionKey != null ? !this.encryptionKey.equals(that.encryptionKey) : that.encryptionKey != null) return false; if (this.encryptionKeyProps != null ? !this.encryptionKeyProps.equals(that.encryptionKeyProps) : that.encryptionKeyProps != null) return false; if (this.existingLambdaObj != null ? !this.existingLambdaObj.equals(that.existingLambdaObj) : that.existingLambdaObj != null) return false; if (this.existingQueueObj != null ? !this.existingQueueObj.equals(that.existingQueueObj) : that.existingQueueObj != null) return false; if (this.lambdaFunctionProps != null ? !this.lambdaFunctionProps.equals(that.lambdaFunctionProps) : that.lambdaFunctionProps != null) return false; if (this.maxReceiveCount != null ? !this.maxReceiveCount.equals(that.maxReceiveCount) : that.maxReceiveCount != null) return false; if (this.queueProps != null ? !this.queueProps.equals(that.queueProps) : that.queueProps != null) return false; return this.sqsEventSourceProps != null ? this.sqsEventSourceProps.equals(that.sqsEventSourceProps) : that.sqsEventSourceProps == null; } @Override public final int hashCode() { int result = this.deadLetterQueueProps != null ? this.deadLetterQueueProps.hashCode() : 0; result = 31 * result + (this.deployDeadLetterQueue != null ? this.deployDeadLetterQueue.hashCode() : 0); result = 31 * result + (this.enableEncryptionWithCustomerManagedKey != null ? this.enableEncryptionWithCustomerManagedKey.hashCode() : 0); result = 31 * result + (this.encryptionKey != null ? this.encryptionKey.hashCode() : 0); result = 31 * result + (this.encryptionKeyProps != null ? this.encryptionKeyProps.hashCode() : 0); result = 31 * result + (this.existingLambdaObj != null ? this.existingLambdaObj.hashCode() : 0); result = 31 * result + (this.existingQueueObj != null ? this.existingQueueObj.hashCode() : 0); result = 31 * result + (this.lambdaFunctionProps != null ? this.lambdaFunctionProps.hashCode() : 0); result = 31 * result + (this.maxReceiveCount != null ? this.maxReceiveCount.hashCode() : 0); result = 31 * result + (this.queueProps != null ? this.queueProps.hashCode() : 0); result = 31 * result + (this.sqsEventSourceProps != null ? this.sqsEventSourceProps.hashCode() : 0); return result; } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy