Class Queue
A new Amazon SQS queue.
Inherited Members
Namespace: Amazon.CDK.AWS.SQS
Assembly: Amazon.CDK.AWS.SQS.dll
Syntax (csharp)
public class Queue : QueueBase, IQueue, IResource, IConstruct, IDependable
Syntax (vb)
Public Class Queue
Inherits QueueBase
Implements IQueue, IResource, IConstruct, IDependable
Remarks
ExampleMetadata: infused
Examples
// An sqs queue for unsuccessful invocations of a lambda function
using Amazon.CDK.AWS.SQS;
var deadLetterQueue = new Queue(this, "DeadLetterQueue");
var myFn = new Function(this, "Fn", new FunctionProps {
Runtime = Runtime.NODEJS_14_X,
Handler = "index.handler",
Code = Code.FromInline("// your code"),
// sqs queue for unsuccessful invocations
OnFailure = new SqsDestination(deadLetterQueue)
});
Synopsis
Constructors
Queue(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
Queue(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Queue(Construct, String, IQueueProps) |
Properties
AutoCreatePolicy | Controls automatic creation of policy objects. |
DeadLetterQueue | If this queue is configured with a dead-letter queue, this is the dead-letter queue settings. |
EncryptionMasterKey | If this queue is encrypted, this is the KMS key. |
Fifo | Whether this queue is an Amazon SQS FIFO queue. |
QueueArn | The ARN of this queue. |
QueueName | The name of this queue. |
QueueUrl | The URL of this queue. |
Methods
FromQueueArn(Construct, String, String) | Import an existing SQS queue provided an ARN. |
FromQueueAttributes(Construct, String, IQueueAttributes) | Import an existing queue. |
Constructors
Queue(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected Queue(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
Queue(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected Queue(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Queue(Construct, String, IQueueProps)
public Queue(Construct scope, string id, IQueueProps props = null)
Parameters
- scope Constructs.Construct
- id System.String
- props IQueueProps
Properties
AutoCreatePolicy
Controls automatic creation of policy objects.
protected override bool AutoCreatePolicy { get; }
Property Value
System.Boolean
Overrides
Remarks
Set by subclasses.
DeadLetterQueue
If this queue is configured with a dead-letter queue, this is the dead-letter queue settings.
public virtual IDeadLetterQueue DeadLetterQueue { get; }
Property Value
EncryptionMasterKey
If this queue is encrypted, this is the KMS key.
public override IKey EncryptionMasterKey { get; }
Property Value
Overrides
Fifo
Whether this queue is an Amazon SQS FIFO queue.
public override bool Fifo { get; }
Property Value
System.Boolean
Overrides
Remarks
If false, this is a standard queue.
QueueArn
The ARN of this queue.
public override string QueueArn { get; }
Property Value
System.String
Overrides
QueueName
The name of this queue.
public override string QueueName { get; }
Property Value
System.String
Overrides
QueueUrl
The URL of this queue.
public override string QueueUrl { get; }
Property Value
System.String
Overrides
Methods
FromQueueArn(Construct, String, String)
Import an existing SQS queue provided an ARN.
public static IQueue FromQueueArn(Construct scope, string id, string queueArn)
Parameters
- scope Constructs.Construct
The parent creating construct.
- id System.String
The construct's name.
- queueArn System.String
queue ARN (i.e. arn:aws:sqs:us-east-2:444455556666:queue1).
Returns
FromQueueAttributes(Construct, String, IQueueAttributes)
Import an existing queue.
public static IQueue FromQueueAttributes(Construct scope, string id, IQueueAttributes attrs)
Parameters
- scope Constructs.Construct
- id System.String
- attrs IQueueAttributes
Returns