@Generated(value="jsii-pacmak/1.60.0 (build ebcefe6)", date="2022-06-22T23:27:54.427Z") public class CfnQueue extends CfnResource implements IInspectable
The AWS::SQS::Queue
resource creates an Amazon SQS standard or FIFO queue.
Keep the following caveats in mind:
FifoQueue
property, Amazon SQS creates a standard queue.
You can't change the queue type after you create it and you can't convert an existing standard queue into a FIFO queue. You must either create a new FIFO queue for your application or delete your existing standard queue and recreate it as a FIFO queue. For more information, see Moving from a standard queue to a FIFO queue in the Amazon SQS Developer Guide .
For more information about creating FIFO (first-in-first-out) queues, see Creating an Amazon SQS queue ( AWS CloudFormation ) in the Amazon SQS Developer Guide .
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import software.amazon.awscdk.services.sqs.*; Object redriveAllowPolicy; Object redrivePolicy; CfnQueue cfnQueue = CfnQueue.Builder.create(this, "MyCfnQueue") .contentBasedDeduplication(false) .deduplicationScope("deduplicationScope") .delaySeconds(123) .fifoQueue(false) .fifoThroughputLimit("fifoThroughputLimit") .kmsDataKeyReusePeriodSeconds(123) .kmsMasterKeyId("kmsMasterKeyId") .maximumMessageSize(123) .messageRetentionPeriod(123) .queueName("queueName") .receiveMessageWaitTimeSeconds(123) .redriveAllowPolicy(redriveAllowPolicy) .redrivePolicy(redrivePolicy) .sqsManagedSseEnabled(false) .tags(List.of(CfnTag.builder() .key("key") .value("value") .build())) .visibilityTimeout(123) .build();
Modifier and Type | Class and Description |
---|---|
static class |
CfnQueue.Builder
A fluent builder for
CfnQueue . |
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
IConstruct.Jsii$Default
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
Modifier | Constructor and Description |
---|---|
|
CfnQueue(Construct scope,
java.lang.String id)
Create a new `AWS::SQS::Queue`.
|
|
CfnQueue(Construct scope,
java.lang.String id,
CfnQueueProps props)
Create a new `AWS::SQS::Queue`.
|
protected |
CfnQueue(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnQueue(software.amazon.jsii.JsiiObjectRef objRef) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAttrArn()
Returns the Amazon Resource Name (ARN) of the queue.
|
java.lang.String |
getAttrQueueName()
Returns the queue name.
|
java.lang.String |
getAttrQueueUrl() |
protected java.util.Map<java.lang.String,java.lang.Object> |
getCfnProperties() |
java.lang.Object |
getContentBasedDeduplication()
For first-in-first-out (FIFO) queues, specifies whether to enable content-based deduplication.
|
java.lang.String |
getDeduplicationScope()
For high throughput for FIFO queues, specifies whether message deduplication occurs at the message group or queue level.
|
java.lang.Number |
getDelaySeconds()
The time in seconds for which the delivery of all messages in the queue is delayed.
|
java.lang.Object |
getFifoQueue()
If set to true, creates a FIFO queue.
|
java.lang.String |
getFifoThroughputLimit()
For high throughput for FIFO queues, specifies whether the FIFO queue throughput quota applies to the entire queue or per message group.
|
java.lang.Number |
getKmsDataKeyReusePeriodSeconds()
The length of time in seconds for which Amazon SQS can reuse a data key to encrypt or decrypt messages before calling AWS KMS again.
|
java.lang.String |
getKmsMasterKeyId()
The ID of an AWS managed customer master key (CMK) for Amazon SQS or a custom CMK.
|
java.lang.Number |
getMaximumMessageSize()
The limit of how many bytes that a message can contain before Amazon SQS rejects it.
|
java.lang.Number |
getMessageRetentionPeriod()
The number of seconds that Amazon SQS retains a message.
|
java.lang.String |
getQueueName()
A name for the queue.
|
java.lang.Number |
getReceiveMessageWaitTimeSeconds()
Specifies the duration, in seconds, that the ReceiveMessage action call waits until a message is in the queue in order to include it in the response, rather than returning an empty response if a message isn't yet available.
|
java.lang.Object |
getRedriveAllowPolicy()
The string that includes the parameters for the permissions for the dead-letter queue redrive permission and which source queues can specify dead-letter queues as a JSON object.
|
java.lang.Object |
getRedrivePolicy()
The string that includes the parameters for the dead-letter queue functionality of the source queue as a JSON object.
|
java.lang.Object |
getSqsManagedSseEnabled()
`AWS::SQS::Queue.SqsManagedSseEnabled`.
|
TagManager |
getTags()
The tags that you attach to this queue.
|
java.lang.Number |
getVisibilityTimeout()
The length of time during which a message will be unavailable after a message is delivered from the queue.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
renderProperties(java.util.Map<java.lang.String,java.lang.Object> props) |
void |
setContentBasedDeduplication(java.lang.Boolean value)
For first-in-first-out (FIFO) queues, specifies whether to enable content-based deduplication.
|
void |
setContentBasedDeduplication(IResolvable value)
For first-in-first-out (FIFO) queues, specifies whether to enable content-based deduplication.
|
void |
setDeduplicationScope(java.lang.String value)
For high throughput for FIFO queues, specifies whether message deduplication occurs at the message group or queue level.
|
void |
setDelaySeconds(java.lang.Number value)
The time in seconds for which the delivery of all messages in the queue is delayed.
|
void |
setFifoQueue(java.lang.Boolean value)
If set to true, creates a FIFO queue.
|
void |
setFifoQueue(IResolvable value)
If set to true, creates a FIFO queue.
|
void |
setFifoThroughputLimit(java.lang.String value)
For high throughput for FIFO queues, specifies whether the FIFO queue throughput quota applies to the entire queue or per message group.
|
void |
setKmsDataKeyReusePeriodSeconds(java.lang.Number value)
The length of time in seconds for which Amazon SQS can reuse a data key to encrypt or decrypt messages before calling AWS KMS again.
|
void |
setKmsMasterKeyId(java.lang.String value)
The ID of an AWS managed customer master key (CMK) for Amazon SQS or a custom CMK.
|
void |
setMaximumMessageSize(java.lang.Number value)
The limit of how many bytes that a message can contain before Amazon SQS rejects it.
|
void |
setMessageRetentionPeriod(java.lang.Number value)
The number of seconds that Amazon SQS retains a message.
|
void |
setQueueName(java.lang.String value)
A name for the queue.
|
void |
setReceiveMessageWaitTimeSeconds(java.lang.Number value)
Specifies the duration, in seconds, that the ReceiveMessage action call waits until a message is in the queue in order to include it in the response, rather than returning an empty response if a message isn't yet available.
|
void |
setRedriveAllowPolicy(java.lang.Object value)
The string that includes the parameters for the permissions for the dead-letter queue redrive permission and which source queues can specify dead-letter queues as a JSON object.
|
void |
setRedrivePolicy(java.lang.Object value)
The string that includes the parameters for the dead-letter queue functionality of the source queue as a JSON object.
|
void |
setSqsManagedSseEnabled(java.lang.Boolean value)
`AWS::SQS::Queue.SqsManagedSseEnabled`.
|
void |
setSqsManagedSseEnabled(IResolvable value)
`AWS::SQS::Queue.SqsManagedSseEnabled`.
|
void |
setVisibilityTimeout(java.lang.Number value)
The length of time during which a message will be unavailable after a message is delivered from the queue.
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validateProperties
getRef
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
public static final java.lang.String CFN_RESOURCE_TYPE_NAME
protected CfnQueue(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnQueue(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public CfnQueue(Construct scope, java.lang.String id, CfnQueueProps props)
scope
- - scope in which this resource is defined. This parameter is required.id
- - scoped id of the resource. This parameter is required.props
- - resource properties.public CfnQueue(Construct scope, java.lang.String id)
scope
- - scope in which this resource is defined. This parameter is required.id
- - scoped id of the resource. This parameter is required.public void inspect(TreeInspector inspector)
inspect
in interface IInspectable
inspector
- - tree inspector to collect and process attributes. This parameter is required.protected java.util.Map<java.lang.String,java.lang.Object> renderProperties(java.util.Map<java.lang.String,java.lang.Object> props)
renderProperties
in class CfnResource
props
- This parameter is required.public java.lang.String getAttrArn()
For example: arn:aws:sqs:us-east-2:123456789012:mystack-myqueue-15PG5C2FC1CW8
.
public java.lang.String getAttrQueueName()
For example: mystack-myqueue-1VF9BKQH5BJVI
.
public java.lang.String getAttrQueueUrl()
protected java.util.Map<java.lang.String,java.lang.Object> getCfnProperties()
getCfnProperties
in class CfnResource
public TagManager getTags()
For more information, see Resource tag in the AWS CloudFormation User Guide .
public java.lang.Object getRedriveAllowPolicy()
The parameters are as follows:
redrivePermission
: The permission type that defines which source queues can specify the current queue as the dead-letter queue. Valid values are:allowAll
: (Default) Any source queues in this AWS account in the same Region can specify this queue as the dead-letter queue.denyAll
: No source queues can specify this queue as the dead-letter queue.byQueue
: Only queues specified by the sourceQueueArns
parameter can specify this queue as the dead-letter queue.sourceQueueArns
: The Amazon Resource Names (ARN)s of the source queues that can specify this queue as the dead-letter queue and redrive messages. You can specify this parameter only when the redrivePermission
parameter is set to byQueue
. You can specify up to 10 source queue ARNs. To allow more than 10 source queues to specify dead-letter queues, set the redrivePermission
parameter to allowAll
.public void setRedriveAllowPolicy(java.lang.Object value)
The parameters are as follows:
redrivePermission
: The permission type that defines which source queues can specify the current queue as the dead-letter queue. Valid values are:allowAll
: (Default) Any source queues in this AWS account in the same Region can specify this queue as the dead-letter queue.denyAll
: No source queues can specify this queue as the dead-letter queue.byQueue
: Only queues specified by the sourceQueueArns
parameter can specify this queue as the dead-letter queue.sourceQueueArns
: The Amazon Resource Names (ARN)s of the source queues that can specify this queue as the dead-letter queue and redrive messages. You can specify this parameter only when the redrivePermission
parameter is set to byQueue
. You can specify up to 10 source queue ARNs. To allow more than 10 source queues to specify dead-letter queues, set the redrivePermission
parameter to allowAll
.public java.lang.Object getRedrivePolicy()
The parameters are as follows:
deadLetterTargetArn
: The Amazon Resource Name (ARN) of the dead-letter queue to which Amazon SQS moves messages after the value of maxReceiveCount
is exceeded.maxReceiveCount
: The number of times a message is delivered to the source queue before being moved to the dead-letter queue. When the ReceiveCount
for a message exceeds the maxReceiveCount
for a queue, Amazon SQS moves the message to the dead-letter-queue.
The dead-letter queue of a FIFO queue must also be a FIFO queue. Similarly, the dead-letter queue of a standard queue must also be a standard queue.
JSON
{ "deadLetterTargetArn" : *String* , "maxReceiveCount" : *Integer* }
YAML
deadLetterTargetArn : *String*
maxReceiveCount : *Integer*
public void setRedrivePolicy(java.lang.Object value)
The parameters are as follows:
deadLetterTargetArn
: The Amazon Resource Name (ARN) of the dead-letter queue to which Amazon SQS moves messages after the value of maxReceiveCount
is exceeded.maxReceiveCount
: The number of times a message is delivered to the source queue before being moved to the dead-letter queue. When the ReceiveCount
for a message exceeds the maxReceiveCount
for a queue, Amazon SQS moves the message to the dead-letter-queue.
The dead-letter queue of a FIFO queue must also be a FIFO queue. Similarly, the dead-letter queue of a standard queue must also be a standard queue.
JSON
{ "deadLetterTargetArn" : *String* , "maxReceiveCount" : *Integer* }
YAML
deadLetterTargetArn : *String*
maxReceiveCount : *Integer*
public java.lang.Object getContentBasedDeduplication()
During the deduplication interval, Amazon SQS treats messages that are sent with identical content as duplicates and delivers only one copy of the message. For more information, see the ContentBasedDeduplication
attribute for the [CreateQueue](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_CreateQueue.html)
action in the Amazon SQS API Reference .
public void setContentBasedDeduplication(java.lang.Boolean value)
During the deduplication interval, Amazon SQS treats messages that are sent with identical content as duplicates and delivers only one copy of the message. For more information, see the ContentBasedDeduplication
attribute for the [CreateQueue](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_CreateQueue.html)
action in the Amazon SQS API Reference .
public void setContentBasedDeduplication(IResolvable value)
During the deduplication interval, Amazon SQS treats messages that are sent with identical content as duplicates and delivers only one copy of the message. For more information, see the ContentBasedDeduplication
attribute for the [CreateQueue](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_CreateQueue.html)
action in the Amazon SQS API Reference .
public java.lang.String getDeduplicationScope()
Valid values are messageGroup
and queue
.
To enable high throughput for a FIFO queue, set this attribute to messageGroup
and set the FifoThroughputLimit
attribute to perMessageGroupId
. If you set these attributes to anything other than these values, normal throughput is in effect and deduplication occurs as specified. For more information, see High throughput for FIFO queues and Quotas related to messages in the Amazon SQS Developer Guide .
public void setDeduplicationScope(java.lang.String value)
Valid values are messageGroup
and queue
.
To enable high throughput for a FIFO queue, set this attribute to messageGroup
and set the FifoThroughputLimit
attribute to perMessageGroupId
. If you set these attributes to anything other than these values, normal throughput is in effect and deduplication occurs as specified. For more information, see High throughput for FIFO queues and Quotas related to messages in the Amazon SQS Developer Guide .
public java.lang.Number getDelaySeconds()
You can specify an integer value of 0
to 900
(15 minutes). The default value is 0
.
public void setDelaySeconds(java.lang.Number value)
You can specify an integer value of 0
to 900
(15 minutes). The default value is 0
.
public java.lang.Object getFifoQueue()
If you don't specify this property, Amazon SQS creates a standard queue. For more information, see FIFO queues in the Amazon SQS Developer Guide .
public void setFifoQueue(java.lang.Boolean value)
If you don't specify this property, Amazon SQS creates a standard queue. For more information, see FIFO queues in the Amazon SQS Developer Guide .
public void setFifoQueue(IResolvable value)
If you don't specify this property, Amazon SQS creates a standard queue. For more information, see FIFO queues in the Amazon SQS Developer Guide .
public java.lang.String getFifoThroughputLimit()
Valid values are perQueue
and perMessageGroupId
.
To enable high throughput for a FIFO queue, set this attribute to perMessageGroupId
and set the DeduplicationScope
attribute to messageGroup
. If you set these attributes to anything other than these values, normal throughput is in effect and deduplication occurs as specified. For more information, see High throughput for FIFO queues and Quotas related to messages in the Amazon SQS Developer Guide .
public void setFifoThroughputLimit(java.lang.String value)
Valid values are perQueue
and perMessageGroupId
.
To enable high throughput for a FIFO queue, set this attribute to perMessageGroupId
and set the DeduplicationScope
attribute to messageGroup
. If you set these attributes to anything other than these values, normal throughput is in effect and deduplication occurs as specified. For more information, see High throughput for FIFO queues and Quotas related to messages in the Amazon SQS Developer Guide .
public java.lang.Number getKmsDataKeyReusePeriodSeconds()
The value must be an integer between 60 (1 minute) and 86,400 (24 hours). The default is 300 (5 minutes).
A shorter time period provides better security, but results in more calls to AWS KMS , which might incur charges after Free Tier. For more information, see Encryption at rest in the Amazon SQS Developer Guide .
public void setKmsDataKeyReusePeriodSeconds(java.lang.Number value)
The value must be an integer between 60 (1 minute) and 86,400 (24 hours). The default is 300 (5 minutes).
A shorter time period provides better security, but results in more calls to AWS KMS , which might incur charges after Free Tier. For more information, see Encryption at rest in the Amazon SQS Developer Guide .
public java.lang.String getKmsMasterKeyId()
To use the AWS managed CMK for Amazon SQS , specify the (default) alias alias/aws/sqs
. For more information, see the following:
public void setKmsMasterKeyId(java.lang.String value)
To use the AWS managed CMK for Amazon SQS , specify the (default) alias alias/aws/sqs
. For more information, see the following:
public java.lang.Number getMaximumMessageSize()
You can specify an integer value from 1,024
bytes (1 KiB) to 262,144
bytes (256 KiB). The default value is 262,144
(256 KiB).
public void setMaximumMessageSize(java.lang.Number value)
You can specify an integer value from 1,024
bytes (1 KiB) to 262,144
bytes (256 KiB). The default value is 262,144
(256 KiB).
public java.lang.Number getMessageRetentionPeriod()
You can specify an integer value from 60
seconds (1 minute) to 1,209,600
seconds (14 days). The default value is 345,600
seconds (4 days).
public void setMessageRetentionPeriod(java.lang.Number value)
You can specify an integer value from 60
seconds (1 minute) to 1,209,600
seconds (14 days). The default value is 345,600
seconds (4 days).
public java.lang.String getQueueName()
To create a FIFO queue, the name of your FIFO queue must end with the .fifo
suffix. For more information, see FIFO queues in the Amazon SQS Developer Guide .
If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the queue name. For more information, see Name type in the AWS CloudFormation User Guide .
If you specify a name, you can't perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name.
public void setQueueName(java.lang.String value)
To create a FIFO queue, the name of your FIFO queue must end with the .fifo
suffix. For more information, see FIFO queues in the Amazon SQS Developer Guide .
If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the queue name. For more information, see Name type in the AWS CloudFormation User Guide .
If you specify a name, you can't perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name.
public java.lang.Number getReceiveMessageWaitTimeSeconds()
You can specify an integer from 1 to 20. Short polling is used as the default or when you specify 0 for this property. For more information, see Consuming messages using long polling in the Amazon SQS Developer Guide .
public void setReceiveMessageWaitTimeSeconds(java.lang.Number value)
You can specify an integer from 1 to 20. Short polling is used as the default or when you specify 0 for this property. For more information, see Consuming messages using long polling in the Amazon SQS Developer Guide .
public java.lang.Object getSqsManagedSseEnabled()
public void setSqsManagedSseEnabled(java.lang.Boolean value)
public void setSqsManagedSseEnabled(IResolvable value)
public java.lang.Number getVisibilityTimeout()
This blocks other components from receiving the same message and gives the initial component time to process and delete the message from the queue.
Values must be from 0 to 43,200 seconds (12 hours). If you don't specify a value, AWS CloudFormation uses the default value of 30 seconds.
For more information about Amazon SQS queue visibility timeouts, see Visibility timeout in the Amazon SQS Developer Guide .
public void setVisibilityTimeout(java.lang.Number value)
This blocks other components from receiving the same message and gives the initial component time to process and delete the message from the queue.
Values must be from 0 to 43,200 seconds (12 hours). If you don't specify a value, AWS CloudFormation uses the default value of 30 seconds.
For more information about Amazon SQS queue visibility timeouts, see Visibility timeout in the Amazon SQS Developer Guide .