Skip to content

wearetechnative/terraform-aws-sqs-dlq

Repository files navigation

Terraform AWS [sqs-dlq]

This module implements a SQS configured as deadletter queue.

How does it work

This SQS implements no KMS CMK and a very lenient policy in order to catch any messages that are not processed properly. This SQS module is different in that its policy allows all types of certain resources to make it easily usable. Least privilege is difficult because many services with DLQ support rely on service principals. So we just add them all by default.

You generally have one DLQ per account and region to catch any infrastructure issues from other infrastructure components.

It's not recommended to use this DLQ as a DLQ from the application point of view as it could expose sensitive data.

We have a CloudWatch alarm that allows you to warn any incident system automatically with terraform-aws-observability-sender. The observability-sender listens for any CloudWatch alarms going into alarm that are not performance metrics.

First use after you clone this repository or when .pre-commit-config.yaml is updated

Run pre-commit install to install any guardrails implemented using pre-commit.

See pre-commit installation on how to install pre-commit.

Usage

The primary usecase is demonstrated below:

module "sqs_dlq" {
  source = "git@github.com:TechNative-B-V/modules-aws.git//sqs_dlq?ref=f67aaeb1801526b760d04d4bb461778c9544e054"

  name = "sqs_dlq"
  fifo_queue = false
}

If the SQS is a deadletter queue from another fifo queue then use a fifo deadletter queue (fifi_queue = true).

Providers

Name Version
aws >=4.8.0

Modules

No modules.

Resources

Name Type
aws_cloudwatch_metric_alarm.this resource
aws_sqs_queue.this resource
aws_sqs_queue_policy.this resource
aws_caller_identity.current data source
aws_iam_policy_document.resource-policy data source
aws_iam_policy_document.resource-policy-perservice data source
aws_partition.current data source
aws_region.current data source

Inputs

Name Description Type Default Required
fifo_queue Only FiFo queues can use FiFo queues as DLQ. Set this to true if you require this. bool n/a yes
name Unique name dead letter queue. string n/a yes

Outputs

Name Description
sqs_dlq_arn n/a

About

SQS deadletter queue with all known best practices implemented whenever possible.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages