TerraShelf

Catalog · Messaging · v1.0.0

sqs-queue

Queue, dead-letter queue, redrive policy, and server-side encryption.

Tests passed 6 of 6. Failed 0.

Inputs

NameTypeRequiredDescription
dlq_message_retention_secondsnumbernoHow long the dead-letter queue keeps a message, in seconds.
fifoboolnoCreate a FIFO queue and a FIFO dead-letter queue. Both names then end in .fifo.
kms_key_arnstringnoCustomer managed key ARN or alias used when sse_mode is kms. Must be null for SQS-managed encryption.
max_receive_countnumbernoHow many receives the main queue allows before the redrive policy sends the message to the dead-letter queue.
message_retention_secondsnumbernoHow long the main queue keeps a message, in seconds.
namestringyesQueue name without a .fifo suffix. The module appends .fifo when fifo is true, including on the dead-letter queue.
sse_modestringnoServer-side encryption mode. sqs uses SQS-managed keys. kms requires kms_key_arn.
tagsmap(string)noExtra tags merged onto every taggable resource. ManagedBy and Module are always set by the module.
visibility_timeout_secondsnumbernoVisibility timeout for the main queue, in seconds.

Outputs

NameDescription
caller_contextAccount, partition, and region resolved from data sources.
dlq_arnDead-letter queue ARN.
dlq_fifo_queueTrue when the dead-letter queue is FIFO.
dlq_nameDead-letter queue name. Ends in .fifo when fifo is true.
dlq_urlDead-letter queue URL.
fifo_queueTrue when the main queue is FIFO.
max_receive_countmaxReceiveCount written into the main queue redrive policy.
queue_arnMain queue ARN.
queue_nameMain queue name. Ends in .fifo when fifo is true.
queue_urlMain queue URL.
sqs_managed_sse_enabledTrue when the queues use SQS-managed encryption.
sse_enabledTrue when SQS-managed encryption is on, or a customer managed key is set.
tag_auditTags on every taggable resource this module creates.

Example

The caller supplies the region. This example does not embed an account id.

module "orders" {
  source = "../.."

  name = "orders"
  tags = {
    Example = "basic"
  }
}

Tests

Mock plan excerpt

mocked provider: ARNs and IDs are simulated. This excerpt is from terraform test with a mocked provider, not a live plan.

mocked provider: ARNs and IDs are simulated. This is terraform test -verbose, not a live plan.

tests\sqs-queue.tftest.hcl... in progress
  run "standard_redrive"... pass

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # aws_sqs_queue.dlq will be created
  + resource "aws_sqs_queue" "dlq" {
      + arn                               = (known after apply)
      + deduplication_scope               = (known after apply)
      + fifo_queue                        = false
      + fifo_throughput_limit             = (known after apply)
      + id                                = (known after apply)
      + kms_data_key_reuse_period_seconds = (known after apply)
      + message_retention_seconds         = 1209600
      + name                              = "orders-dlq"
      + name_prefix                       = (known after apply)
      + policy                            = (known after apply)
      + redrive_allow_policy              = (known after apply)
      + redrive_policy                    = (known after apply)
      + sqs_managed_sse_enabled           = true
      + tags                              = {
          + "ManagedBy" = "terraform"
          + "Module"    = "sqs-queue"
          + "Owner"     = "platform"
        }
      + tags_all                          = (known after apply)
      + url                               = (known after apply)
    }

  # aws_sqs_queue.this will be created
  + resource "aws_sqs_queue" "this" {
      + arn                               = (known after apply)
      + deduplication_scope               = (known after apply)
      + fifo_queue                        = false

Resources

graphviz dot was not installed. The figure is a python-hcl2 resource list.

Resource list for sqs-queue

Changelog

Changelog

All notable changes to this module are documented in this file.

The format is based on Keep a Changelog, and this module uses Semantic Versioning.

[1.0.0] - 2026-10-03

Added

Billable item names

Names only. This page does not quote a price. Example amounts, including a budget limit, are placeholders and are not recommendations. GuardDuty and Security Hub stay off unless a module switch is set, because those services are billable.