Class CfnQueue

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IInspectable, ITaggable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.98.0 (build 00b106d)", date="2024-05-24T02:42:44.986Z") @Stability(Stable) public class CfnQueue extends CfnResource implements IInspectable, ITaggable
The AWS::SQS::Queue resource creates an Amazon SQS standard or FIFO queue.

Keep the following caveats in mind:

  • If you don't specify the 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 .

  • If you don't provide a value for a property, the queue is created with the default value for the property.
  • If you delete a queue, you must wait at least 60 seconds before creating a queue with the same name.
  • To successfully create a new queue, you must provide a queue name that adheres to the limits related to queues and is unique within the scope of your queues.

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();
 

See Also:
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnQueue

      protected CfnQueue(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnQueue

      protected CfnQueue(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnQueue

      @Stability(Stable) public CfnQueue(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable CfnQueueProps props)
      Parameters:
      scope - Scope in which this resource is defined. This parameter is required.
      id - Construct identifier for this resource (unique in its scope). This parameter is required.
      props - Resource properties.
    • CfnQueue

      @Stability(Stable) public CfnQueue(@NotNull software.constructs.Construct scope, @NotNull String id)
      Parameters:
      scope - Scope in which this resource is defined. This parameter is required.
      id - Construct identifier for this resource (unique in its scope). This parameter is required.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector - tree inspector to collect and process attributes. This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrArn

      @Stability(Stable) @NotNull public String getAttrArn()
      Returns the Amazon Resource Name (ARN) of the queue.

      For example: arn:aws:sqs:us-east-2:123456789012:mystack-myqueue-15PG5C2FC1CW8 .

    • getAttrQueueName

      @Stability(Stable) @NotNull public String getAttrQueueName()
      Returns the queue name.

      For example: mystack-myqueue-1VF9BKQH5BJVI .

    • getAttrQueueUrl

      @Stability(Stable) @NotNull public String getAttrQueueUrl()
      Returns the URLs of the queues from the policy.
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getTags

      @Stability(Stable) @NotNull public TagManager getTags()
      Tag Manager which manages the tags for this resource.
      Specified by:
      getTags in interface ITaggable
    • getContentBasedDeduplication

      @Stability(Stable) @Nullable public Object getContentBasedDeduplication()
      For first-in-first-out (FIFO) queues, specifies whether to enable content-based deduplication.
    • setContentBasedDeduplication

      @Stability(Stable) public void setContentBasedDeduplication(@Nullable Boolean value)
      For first-in-first-out (FIFO) queues, specifies whether to enable content-based deduplication.
    • setContentBasedDeduplication

      @Stability(Stable) public void setContentBasedDeduplication(@Nullable IResolvable value)
      For first-in-first-out (FIFO) queues, specifies whether to enable content-based deduplication.
    • getDeduplicationScope

      @Stability(Stable) @Nullable public String getDeduplicationScope()
      For high throughput for FIFO queues, specifies whether message deduplication occurs at the message group or queue level.
    • setDeduplicationScope

      @Stability(Stable) public void setDeduplicationScope(@Nullable String value)
      For high throughput for FIFO queues, specifies whether message deduplication occurs at the message group or queue level.
    • getDelaySeconds

      @Stability(Stable) @Nullable public Number getDelaySeconds()
      The time in seconds for which the delivery of all messages in the queue is delayed.
    • setDelaySeconds

      @Stability(Stable) public void setDelaySeconds(@Nullable Number value)
      The time in seconds for which the delivery of all messages in the queue is delayed.
    • getFifoQueue

      @Stability(Stable) @Nullable public Object getFifoQueue()
      If set to true, creates a FIFO queue.
    • setFifoQueue

      @Stability(Stable) public void setFifoQueue(@Nullable Boolean value)
      If set to true, creates a FIFO queue.
    • setFifoQueue

      @Stability(Stable) public void setFifoQueue(@Nullable IResolvable value)
      If set to true, creates a FIFO queue.
    • getFifoThroughputLimit

      @Stability(Stable) @Nullable public String getFifoThroughputLimit()
      For high throughput for FIFO queues, specifies whether the FIFO queue throughput quota applies to the entire queue or per message group.
    • setFifoThroughputLimit

      @Stability(Stable) public void setFifoThroughputLimit(@Nullable String value)
      For high throughput for FIFO queues, specifies whether the FIFO queue throughput quota applies to the entire queue or per message group.
    • getKmsDataKeyReusePeriodSeconds

      @Stability(Stable) @Nullable public 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.
    • setKmsDataKeyReusePeriodSeconds

      @Stability(Stable) public void setKmsDataKeyReusePeriodSeconds(@Nullable 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.
    • getKmsMasterKeyId

      @Stability(Stable) @Nullable public String getKmsMasterKeyId()
      The ID of an AWS Key Management Service (KMS) for Amazon SQS , or a custom KMS.
    • setKmsMasterKeyId

      @Stability(Stable) public void setKmsMasterKeyId(@Nullable String value)
      The ID of an AWS Key Management Service (KMS) for Amazon SQS , or a custom KMS.
    • getMaximumMessageSize

      @Stability(Stable) @Nullable public Number getMaximumMessageSize()
      The limit of how many bytes that a message can contain before Amazon SQS rejects it.
    • setMaximumMessageSize

      @Stability(Stable) public void setMaximumMessageSize(@Nullable Number value)
      The limit of how many bytes that a message can contain before Amazon SQS rejects it.
    • getMessageRetentionPeriod

      @Stability(Stable) @Nullable public Number getMessageRetentionPeriod()
      The number of seconds that Amazon SQS retains a message.
    • setMessageRetentionPeriod

      @Stability(Stable) public void setMessageRetentionPeriod(@Nullable Number value)
      The number of seconds that Amazon SQS retains a message.
    • getQueueName

      @Stability(Stable) @Nullable public String getQueueName()
      A name for the queue.
    • setQueueName

      @Stability(Stable) public void setQueueName(@Nullable String value)
      A name for the queue.
    • getReceiveMessageWaitTimeSeconds

      @Stability(Stable) @Nullable public 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.
    • setReceiveMessageWaitTimeSeconds

      @Stability(Stable) public void setReceiveMessageWaitTimeSeconds(@Nullable 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.
    • getRedriveAllowPolicy

      @Stability(Stable) @Nullable public 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.
    • setRedriveAllowPolicy

      @Stability(Stable) public void setRedriveAllowPolicy(@Nullable 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.
    • getRedrivePolicy

      @Stability(Stable) @Nullable public Object getRedrivePolicy()
      The string that includes the parameters for the dead-letter queue functionality of the source queue as a JSON object.
    • setRedrivePolicy

      @Stability(Stable) public void setRedrivePolicy(@Nullable Object value)
      The string that includes the parameters for the dead-letter queue functionality of the source queue as a JSON object.
    • getSqsManagedSseEnabled

      @Stability(Stable) @Nullable public Object getSqsManagedSseEnabled()
      Enables server-side queue encryption using SQS owned encryption keys.
    • setSqsManagedSseEnabled

      @Stability(Stable) public void setSqsManagedSseEnabled(@Nullable Boolean value)
      Enables server-side queue encryption using SQS owned encryption keys.
    • setSqsManagedSseEnabled

      @Stability(Stable) public void setSqsManagedSseEnabled(@Nullable IResolvable value)
      Enables server-side queue encryption using SQS owned encryption keys.
    • getTagsRaw

      @Stability(Stable) @Nullable public List<CfnTag> getTagsRaw()
      The tags that you attach to this queue.
    • setTagsRaw

      @Stability(Stable) public void setTagsRaw(@Nullable List<CfnTag> value)
      The tags that you attach to this queue.
    • getVisibilityTimeout

      @Stability(Stable) @Nullable public Number getVisibilityTimeout()
      The length of time during which a message will be unavailable after a message is delivered from the queue.
    • setVisibilityTimeout

      @Stability(Stable) public void setVisibilityTimeout(@Nullable Number value)
      The length of time during which a message will be unavailable after a message is delivered from the queue.