queues
Creates, updates, deletes or gets a queue resource or lists queues in a region
Overview
| Name | queues |
| Type | Resource |
| Description | The Keep the following caveats in mind: |
| Id | awscc.sqs.queues |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
queue_url | string | |
arn | string | |
content_based_deduplication | boolean | For first-in-first-out (FIFO) queues, specifies whether to enable content-based deduplication. During the deduplication interval, 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 API Reference. |
deduplication_scope | string | For high throughput for FIFO queues, specifies whether message deduplication occurs at the message group or queue level. Valid values are To enable high throughput for a FIFO queue, set this attribute to |
delay_seconds | integer | The time in seconds for which the delivery of all messages in the queue is delayed. You can specify an integer value of 0 to 900 (15 minutes). The default value is 0. |
fifo_queue | boolean | If set to true, creates a FIFO queue. If you don't specify this property, SQS creates a standard queue. For more information, see Amazon SQS FIFO queues in the Developer Guide. |
fifo_throughput_limit | string | For high throughput for FIFO queues, specifies whether the FIFO queue throughput quota applies to the entire queue or per message group. Valid values are To enable high throughput for a FIFO queue, set this attribute to |
kms_data_key_reuse_period_seconds | integer | The length of time in seconds for which SQS can reuse a data key to encrypt or decrypt messages before calling KMS again. 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 KMS, which might incur charges after Free Tier. For more information, see Encryption at rest in the Developer Guide. |
kms_master_key_id | string | The ID of an AWS Key Management Service (KMS) for SQS, or a custom KMS. To use the AWS managed KMS for SQS, specify a (default) alias ARN, alias name (for example + Encryption at rest in the Developer Guide |
sqs_managed_sse_enabled | boolean | Enables server-side queue encryption using SQS owned encryption keys. Only one server-side encryption option is supported per queue (for example, SSE-KMS or SSE-SQS). When SqsManagedSseEnabled is not defined, SSE-SQS encryption is enabled by default. |
maximum_message_size | integer | The limit of how many bytes that a message can contain before SQS rejects it. 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). |
message_retention_period | integer | The number of seconds that SQS retains a message. 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). |
queue_name | string | A name for the queue. To create a FIFO queue, the name of your FIFO queue must end with the If you don't specify a name, CFN generates a unique physical ID and uses that ID for the queue name. For more information, see Name type in the User Guide. |
receive_message_wait_time_seconds | integer | 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. 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 Developer Guide. |
redrive_allow_policy | object | 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. 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. |
redrive_policy | object | The string that includes the parameters for the dead-letter queue functionality of the source queue as a JSON object. The parameters are as follows:+deadLetterTargetArn: The Amazon Resource Name (ARN) of the dead-letter queue to which SQS moves messages after the value of maxReceiveCount is exceeded.+ maxReceiveCount: The number of times a message is received by a consumer of the source queue before being moved to the dead-letter queue. When the ReceiveCount for a message exceeds the maxReceiveCount for a queue, 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 : StringmaxReceiveCount : Integer |
tags | array | The tags that you attach to this queue. For more information, see Resource tag in the User Guide. |
visibility_timeout | integer | The length of time during which a message will be unavailable after a message is delivered from the queue. 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 SQS queue visibility timeouts, see Visibility timeout in the Developer Guide. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
queue_url | string | |
region | string | AWS region. |
For more information, see AWS::SQS::Queue.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | queues | INSERT | region |
delete_resource | queues | DELETE | Identifier, region |
update_resource | queues | UPDATE | Identifier, PatchDocument, region |
list_resources | queues_list_only | SELECT | region |
get_resource | queues | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual queue.
SELECT
region,
queue_url,
arn,
content_based_deduplication,
deduplication_scope,
delay_seconds,
fifo_queue,
fifo_throughput_limit,
kms_data_key_reuse_period_seconds,
kms_master_key_id,
sqs_managed_sse_enabled,
maximum_message_size,
message_retention_period,
queue_name,
receive_message_wait_time_seconds,
redrive_allow_policy,
redrive_policy,
tags,
visibility_timeout
FROM awscc.sqs.queues
WHERE
region = '{{ region }}' AND
Identifier = '{{ queue_url }}';
Lists all queues in a region.
SELECT
region,
queue_url
FROM awscc.sqs.queues_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new queue resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.sqs.queues (
ContentBasedDeduplication,
DeduplicationScope,
DelaySeconds,
FifoQueue,
FifoThroughputLimit,
KmsDataKeyReusePeriodSeconds,
KmsMasterKeyId,
SqsManagedSseEnabled,
MaximumMessageSize,
MessageRetentionPeriod,
QueueName,
ReceiveMessageWaitTimeSeconds,
RedriveAllowPolicy,
RedrivePolicy,
Tags,
VisibilityTimeout,
region
)
SELECT
'{{ content_based_deduplication }}',
'{{ deduplication_scope }}',
'{{ delay_seconds }}',
'{{ fifo_queue }}',
'{{ fifo_throughput_limit }}',
'{{ kms_data_key_reuse_period_seconds }}',
'{{ kms_master_key_id }}',
'{{ sqs_managed_sse_enabled }}',
'{{ maximum_message_size }}',
'{{ message_retention_period }}',
'{{ queue_name }}',
'{{ receive_message_wait_time_seconds }}',
'{{ redrive_allow_policy }}',
'{{ redrive_policy }}',
'{{ tags }}',
'{{ visibility_timeout }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.sqs.queues (
ContentBasedDeduplication,
DeduplicationScope,
DelaySeconds,
FifoQueue,
FifoThroughputLimit,
KmsDataKeyReusePeriodSeconds,
KmsMasterKeyId,
SqsManagedSseEnabled,
MaximumMessageSize,
MessageRetentionPeriod,
QueueName,
ReceiveMessageWaitTimeSeconds,
RedriveAllowPolicy,
RedrivePolicy,
Tags,
VisibilityTimeout,
region
)
SELECT
'{{ content_based_deduplication }}',
'{{ deduplication_scope }}',
'{{ delay_seconds }}',
'{{ fifo_queue }}',
'{{ fifo_throughput_limit }}',
'{{ kms_data_key_reuse_period_seconds }}',
'{{ kms_master_key_id }}',
'{{ sqs_managed_sse_enabled }}',
'{{ maximum_message_size }}',
'{{ message_retention_period }}',
'{{ queue_name }}',
'{{ receive_message_wait_time_seconds }}',
'{{ redrive_allow_policy }}',
'{{ redrive_policy }}',
'{{ tags }}',
'{{ visibility_timeout }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: queue
props:
- name: content_based_deduplication
value: '{{ content_based_deduplication }}'
- name: deduplication_scope
value: '{{ deduplication_scope }}'
- name: delay_seconds
value: '{{ delay_seconds }}'
- name: fifo_queue
value: '{{ fifo_queue }}'
- name: fifo_throughput_limit
value: '{{ fifo_throughput_limit }}'
- name: kms_data_key_reuse_period_seconds
value: '{{ kms_data_key_reuse_period_seconds }}'
- name: kms_master_key_id
value: '{{ kms_master_key_id }}'
- name: sqs_managed_sse_enabled
value: '{{ sqs_managed_sse_enabled }}'
- name: maximum_message_size
value: '{{ maximum_message_size }}'
- name: message_retention_period
value: '{{ message_retention_period }}'
- name: queue_name
value: '{{ queue_name }}'
- name: receive_message_wait_time_seconds
value: '{{ receive_message_wait_time_seconds }}'
- name: redrive_allow_policy
value: {}
- name: redrive_policy
value: {}
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
- name: visibility_timeout
value: '{{ visibility_timeout }}'
UPDATE example
Use the following StackQL query and manifest file to update a queue resource, using stack-deploy.
/*+ update */
UPDATE awscc.sqs.queues
SET PatchDocument = string('{{ {
"ContentBasedDeduplication": content_based_deduplication,
"DeduplicationScope": deduplication_scope,
"DelaySeconds": delay_seconds,
"FifoThroughputLimit": fifo_throughput_limit,
"KmsDataKeyReusePeriodSeconds": kms_data_key_reuse_period_seconds,
"KmsMasterKeyId": kms_master_key_id,
"SqsManagedSseEnabled": sqs_managed_sse_enabled,
"MaximumMessageSize": maximum_message_size,
"MessageRetentionPeriod": message_retention_period,
"ReceiveMessageWaitTimeSeconds": receive_message_wait_time_seconds,
"RedriveAllowPolicy": redrive_allow_policy,
"RedrivePolicy": redrive_policy,
"Tags": tags,
"VisibilityTimeout": visibility_timeout
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ queue_url }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.sqs.queues
WHERE
Identifier = '{{ queue_url }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
Additional Parameters
Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:
| Parameter | Description |
|---|---|
ClientToken | A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.A client token is valid for 36 hours once used. After that, a resource request with the same client token is treated as a new request. If you do not specify a client token, one is generated for inclusion in the request. |
RoleArn | The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.If you do not specify a role, a temporary session is created using your AWS user credentials. |
TypeVersionId | For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used. |
Permissions
To operate on the queues resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
sqs:CreateQueue,
sqs:GetQueueUrl,
sqs:GetQueueAttributes,
sqs:ListQueueTags,
sqs:TagQueue
sqs:GetQueueAttributes,
sqs:ListQueueTags
sqs:SetQueueAttributes,
sqs:GetQueueAttributes,
sqs:ListQueueTags,
sqs:TagQueue,
sqs:UntagQueue
sqs:DeleteQueue,
sqs:GetQueueAttributes
sqs:ListQueues