AWS Amazon SQS Queue
This page shows how to write Terraform and CloudFormation for Amazon SQS Queue and write them securely.
aws_sqs_queue (Terraform)
The Queue in Amazon SQS can be configured in Terraform with the resource name aws_sqs_queue
. The following sections describe how to use the resource and its parameters.
Example Usage from GitHub
An example could not be found in GitHub.
Parameters
-
arn
optional computed - string -
content_based_deduplication
optional - bool -
delay_seconds
optional - number -
fifo_queue
optional - bool -
id
optional computed - string -
kms_data_key_reuse_period_seconds
optional computed - number -
kms_master_key_id
optional - string -
max_message_size
optional - number -
message_retention_seconds
optional - number -
name
optional computed - string -
name_prefix
optional computed - string -
policy
optional computed - string -
receive_wait_time_seconds
optional - number -
redrive_policy
optional - string -
tags
optional - map from string to string -
visibility_timeout_seconds
optional - number
Explanation in Terraform Registry
AWS::SQS::Queue (CloudFormation)
The Queue in SQS can be configured in CloudFormation with the resource name AWS::SQS::Queue
. The following sections describe 10 examples of how to use the resource and its parameters.
Example Usage from GitHub
Type: AWS::SQS::Queue
Properties:
QueueName: ${self:custom.config.sqs.queues.clip.name}
VisibilityTimeout: 30
RedrivePolicy:
deadLetterTargetArn:
Type: 'AWS::SQS::Queue'
Properties:
VisibilityTimeout: 300
ReceiveMessageWaitTimeSeconds: 20
TagProcessingQueue:
Type: AWS::SQS::Queue
Properties:
QueueName: ${self:service}-${self:provider.stage}-need-queue
RedrivePolicy:
deadLetterTargetArn: !GetAtt
- NeedSQSQueueDLQ
Type: "AWS::SQS::Queue"
Properties:
QueueName: "${self:custom.createTaskQueue}"
ProcessTaskTriggerQueue:
Type: "AWS::SQS::Queue"
Properties:
Type: AWS::SQS::Queue
Properties:
QueueName: mws-report-sub-DE
MwsReportSubPolicyDE:
Type: AWS::SQS::QueuePolicy
Properties:
"Type": "AWS::SQS::Queue",
"Properties": {
"QueueName": "INV_CLOSE_CASHIER",
"DelaySeconds": "0",
"MaximumMessageSize": "262144",
"MessageRetentionPeriod": "86400",
"Type": "AWS::SQS::Queue",
"Properties": {
"QueueName": "queue1"
}
},
"Type": "AWS::SQS::Queue",
"Properties": {
"QueueName": "queue1"
}
},
"mysqspolicy1": {
"Type": "AWS::SQS::Queue",
"Properties": {
"QueueName": "queue1"
}
},
"Type": "AWS::SQS::Queue",
"Properties": {
"QueueName": "queue1"
}
},
Parameters
-
ContentBasedDeduplication
optional - Boolean -
DeduplicationScope
optional - String -
DelaySeconds
optional - Integer -
FifoQueue
optional - Boolean -
FifoThroughputLimit
optional - String -
KmsDataKeyReusePeriodSeconds
optional - Integer -
KmsMasterKeyId
optional - String -
MaximumMessageSize
optional - Integer -
MessageRetentionPeriod
optional - Integer -
QueueName
optional - String -
ReceiveMessageWaitTimeSeconds
optional - Integer -
RedriveAllowPolicy
optional - Json -
RedrivePolicy
optional - Json -
Tags
optional - List of Tag -
VisibilityTimeout
optional - Integer
Explanation in CloudFormation Registry
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.Note 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.
Frequently asked questions
What is AWS Amazon SQS Queue?
AWS Amazon SQS Queue is a resource for Amazon SQS of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.
Where can I find the example code for the AWS Amazon SQS Queue?
For CloudFormation, the fortniteclipz-com/ts_infra, nasa/earthdata-search and drobinki/needs-typescript source code examples are useful. See the CloudFormation Example section for further details.