Class CfnQueue
A CloudFormation AWS::SQS::Queue
.
Inherited Members
Namespace: Amazon.CDK.AWS.SQS
Assembly: Amazon.CDK.AWS.SQS.dll
Syntax (csharp)
public class CfnQueue : CfnResource, IConstruct, IDependable, IInspectable
Syntax (vb)
Public Class CfnQueue
Inherits CfnResource
Implements IConstruct, IDependable, IInspectable
Remarks
The AWS::SQS::Queue
resource creates an Amazon SQS standard or FIFO queue.
Keep the following caveats in mind:
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 <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues-moving.html">Moving from a standard queue to a FIFO queue</a> in the <em>Amazon SQS Developer Guide</em> .
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 .
CloudformationResource: AWS::SQS::Queue
Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sqs-queue.html
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.SQS;
var redriveAllowPolicy;
var redrivePolicy;
var cfnQueue = new CfnQueue(this, "MyCfnQueue", new CfnQueueProps {
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 = new [] { new CfnTag {
Key = "key",
Value = "value"
} },
VisibilityTimeout = 123
});
Synopsis
Constructors
CfnQueue(Construct, String, ICfnQueueProps) | Create a new |
CfnQueue(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
CfnQueue(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Properties
AttrArn | Returns the Amazon Resource Name (ARN) of the queue. |
AttrQueueName | Returns the queue name. |
AttrQueueUrl | Returns the URLs of the queues from the policy. |
CFN_RESOURCE_TYPE_NAME | The CloudFormation resource type name for this resource class. |
CfnProperties | |
ContentBasedDeduplication | For first-in-first-out (FIFO) queues, specifies whether to enable content-based deduplication. |
DeduplicationScope | For high throughput for FIFO queues, specifies whether message deduplication occurs at the message group or queue level. |
DelaySeconds | The time in seconds for which the delivery of all messages in the queue is delayed. |
FifoQueue | If set to true, creates a FIFO queue. |
FifoThroughputLimit | For high throughput for FIFO queues, specifies whether the FIFO queue throughput quota applies to the entire queue or per message group. |
KmsDataKeyReusePeriodSeconds | 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. |
KmsMasterKeyId | The ID of an AWS Key Management Service (KMS) for Amazon SQS , or a custom KMS. |
MaximumMessageSize | The limit of how many bytes that a message can contain before Amazon SQS rejects it. |
MessageRetentionPeriod | The number of seconds that Amazon SQS retains a message. |
QueueName | A name for the queue. |
ReceiveMessageWaitTimeSeconds | 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. |
RedriveAllowPolicy | 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. |
RedrivePolicy | The string that includes the parameters for the dead-letter queue functionality of the source queue as a JSON object. |
SqsManagedSseEnabled | Enables server-side queue encryption using SQS owned encryption keys. |
Tags | The tags that you attach to this queue. |
VisibilityTimeout | The length of time during which a message will be unavailable after a message is delivered from the queue. |
Methods
Inspect(TreeInspector) | Examines the CloudFormation resource and discloses attributes. |
RenderProperties(IDictionary<String, Object>) |
Constructors
CfnQueue(Construct, String, ICfnQueueProps)
Create a new AWS::SQS::Queue
.
public CfnQueue(Construct scope, string id, ICfnQueueProps props = null)
Parameters
- scope Construct
- scope in which this resource is defined.
- id System.String
- scoped id of the resource.
- props ICfnQueueProps
- resource properties.
CfnQueue(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected CfnQueue(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
CfnQueue(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected CfnQueue(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Properties
AttrArn
Returns the Amazon Resource Name (ARN) of the queue.
public virtual string AttrArn { get; }
Property Value
System.String
Remarks
For example: arn:aws:sqs:us-east-2:123456789012:mystack-myqueue-15PG5C2FC1CW8
.
CloudformationAttribute: Arn
AttrQueueName
Returns the queue name.
public virtual string AttrQueueName { get; }
Property Value
System.String
Remarks
For example: mystack-myqueue-1VF9BKQH5BJVI
.
CloudformationAttribute: QueueName
AttrQueueUrl
Returns the URLs of the queues from the policy.
public virtual string AttrQueueUrl { get; }
Property Value
System.String
Remarks
CloudformationAttribute: QueueUrl
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
public static string CFN_RESOURCE_TYPE_NAME { get; }
Property Value
System.String
CfnProperties
protected override IDictionary<string, object> CfnProperties { get; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.Object>
Overrides
ContentBasedDeduplication
For first-in-first-out (FIFO) queues, specifies whether to enable content-based deduplication.
public virtual object ContentBasedDeduplication { get; set; }
Property Value
System.Object
Remarks
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
action in the Amazon SQS API Reference .
DeduplicationScope
For high throughput for FIFO queues, specifies whether message deduplication occurs at the message group or queue level.
public virtual string DeduplicationScope { get; set; }
Property Value
System.String
Remarks
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 .
DelaySeconds
The time in seconds for which the delivery of all messages in the queue is delayed.
public virtual Nullable<double> DelaySeconds { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
You can specify an integer value of 0
to 900
(15 minutes). The default value is 0
.
FifoQueue
If set to true, creates a FIFO queue.
public virtual object FifoQueue { get; set; }
Property Value
System.Object
Remarks
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 .
FifoThroughputLimit
For high throughput for FIFO queues, specifies whether the FIFO queue throughput quota applies to the entire queue or per message group.
public virtual string FifoThroughputLimit { get; set; }
Property Value
System.String
Remarks
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 .
KmsDataKeyReusePeriodSeconds
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.
public virtual Nullable<double> KmsDataKeyReusePeriodSeconds { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
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 .
KmsMasterKeyId
The ID of an AWS Key Management Service (KMS) for Amazon SQS , or a custom KMS.
public virtual string KmsMasterKeyId { get; set; }
Property Value
System.String
Remarks
To use the AWS managed KMS for Amazon SQS , specify a (default) alias ARN, alias name (e.g. alias/aws/sqs
), key ARN, or key ID. For more information, see the following:
MaximumMessageSize
The limit of how many bytes that a message can contain before Amazon SQS rejects it.
public virtual Nullable<double> MaximumMessageSize { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
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).
MessageRetentionPeriod
The number of seconds that Amazon SQS retains a message.
public virtual Nullable<double> MessageRetentionPeriod { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
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).
QueueName
A name for the queue.
public virtual string QueueName { get; set; }
Property Value
System.String
Remarks
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.
ReceiveMessageWaitTimeSeconds
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.
public virtual Nullable<double> ReceiveMessageWaitTimeSeconds { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
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 .
RedriveAllowPolicy
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.
public virtual object RedriveAllowPolicy { get; set; }
Property Value
System.Object
Remarks
The parameters are as follows:
RedrivePolicy
The string that includes the parameters for the dead-letter queue functionality of the source queue as a JSON object.
public virtual object RedrivePolicy { get; set; }
Property Value
System.Object
Remarks
The parameters are as follows:
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
SqsManagedSseEnabled
Enables server-side queue encryption using SQS owned encryption keys.
public virtual object SqsManagedSseEnabled { get; set; }
Property Value
System.Object
Remarks
Tags
The tags that you attach to this queue.
public virtual TagManager Tags { get; }
Property Value
Remarks
For more information, see Resource tag in the AWS CloudFormation User Guide .
VisibilityTimeout
The length of time during which a message will be unavailable after a message is delivered from the queue.
public virtual Nullable<double> VisibilityTimeout { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
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 .
Methods
Inspect(TreeInspector)
Examines the CloudFormation resource and discloses attributes.
public virtual void Inspect(TreeInspector inspector)
Parameters
- inspector TreeInspector
- tree inspector to collect and process attributes.
RenderProperties(IDictionary<String, Object>)
protected override IDictionary<string, object> RenderProperties(IDictionary<string, object> props)
Parameters
- props System.Collections.Generic.IDictionary<System.String, System.Object>
Returns
System.Collections.Generic.IDictionary<System.String, System.Object>