java.lang.Object
software.amazon.jsii.JsiiObject
All Implemented Interfaces:
IConstruct, IDependable, IResource, IQueue, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:38.040Z") @Stability(Stable) public class Queue extends QueueBase
A new Amazon SQS queue.

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_14_X)
         .handler("index.handler")
         .code(Code.fromInline("// your code"))
         // sqs queue for unsuccessful invocations
         .onFailure(new SqsDestination(deadLetterQueue))
         .build();
 
  • Constructor Details

    • Queue

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

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

      @Stability(Stable) public Queue(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable QueueProps props)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      props -
    • Queue

      @Stability(Stable) public Queue(@NotNull software.constructs.Construct scope, @NotNull String id)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
  • Method Details

    • fromQueueArn

      @Stability(Stable) @NotNull public static IQueue fromQueueArn(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String queueArn)
      Import an existing SQS queue provided an ARN.

      Parameters:
      scope - The parent creating construct. This parameter is required.
      id - The construct's name. This parameter is required.
      queueArn - queue ARN (i.e. arn:aws:sqs:us-east-2:444455556666:queue1). This parameter is required.
    • fromQueueAttributes

      @Stability(Stable) @NotNull public static IQueue fromQueueAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull QueueAttributes attrs)
      Import an existing queue.

      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      attrs - This parameter is required.
    • getAutoCreatePolicy

      @Stability(Stable) @NotNull protected Boolean getAutoCreatePolicy()
      Controls automatic creation of policy objects.

      Set by subclasses.

      Specified by:
      getAutoCreatePolicy in class QueueBase
    • getFifo

      @Stability(Stable) @NotNull public Boolean getFifo()
      Whether this queue is an Amazon SQS FIFO queue.

      If false, this is a standard queue.

      Specified by:
      getFifo in interface IQueue
      Specified by:
      getFifo in class QueueBase
    • getQueueArn

      @Stability(Stable) @NotNull public String getQueueArn()
      The ARN of this queue.
      Specified by:
      getQueueArn in interface IQueue
      Specified by:
      getQueueArn in class QueueBase
    • getQueueName

      @Stability(Stable) @NotNull public String getQueueName()
      The name of this queue.
      Specified by:
      getQueueName in interface IQueue
      Specified by:
      getQueueName in class QueueBase
    • getQueueUrl

      @Stability(Stable) @NotNull public String getQueueUrl()
      The URL of this queue.
      Specified by:
      getQueueUrl in interface IQueue
      Specified by:
      getQueueUrl in class QueueBase
    • getDeadLetterQueue

      @Stability(Stable) @Nullable public DeadLetterQueue getDeadLetterQueue()
      If this queue is configured with a dead-letter queue, this is the dead-letter queue settings.
    • getEncryptionMasterKey

      @Stability(Stable) @Nullable public IKey getEncryptionMasterKey()
      If this queue is encrypted, this is the KMS key.
      Specified by:
      getEncryptionMasterKey in interface IQueue
      Specified by:
      getEncryptionMasterKey in class QueueBase