Skip to content

Terraform Module for creating an SQS queue and an accompanying dead letter queue (dlq).

License

Notifications You must be signed in to change notification settings

rafaelonline/terraform-aws-sqs-with-dlq

Repository files navigation

Terraform module AWS SQS with DLQ

Terraform Module for creating an SQS queue and an accompanying dead letter queue (dlq).

This module automatically adds:

  • .fifo if a fifo queue is selected

  • CloudWatch alarm (with notification by e-mail) for items on the dlq and large numbers of items on a queue

  • A default policy to the queue

  • Allows for easy adding of custom policy to the queue/dlq

  • Enables encrypted queues using the CMK account key

Examples

Requirements

Name Version
terraform >= 0.13.6
aws >= 3.60.0, <= 3.69.0

Providers

Name Version
aws >= 3.60.0, <= 3.69.0

Modules

No modules.

Resources

Name Type
aws_cloudwatch_metric_alarm.alarm resource
aws_cloudwatch_metric_alarm.deadletter_alarm resource
aws_kms_alias.sns resource
aws_kms_alias.sqs resource
aws_kms_key.sns resource
aws_kms_key.sqs resource
aws_sns_topic.alarm resource
aws_sns_topic_policy.alarm resource
aws_sns_topic_subscription.alarm resource
aws_sqs_queue.deadletter_queue resource
aws_sqs_queue.queue resource
aws_sqs_queue_policy.deadletter_queue resource
aws_sqs_queue_policy.queue resource
aws_arn.deadletter_queue data source
aws_arn.queue data source
aws_caller_identity.current data source
aws_iam_policy_document.deadletter_queue data source
aws_iam_policy_document.queue data source
aws_iam_policy_document.sns_topic_policy data source

Inputs

Name Description Type Default Required
alarm_sns_topic_arn ARN of the SNS topic for alarm notifactions string "" no
allowed_items_max The maximum number of items allowed on the SQS queue before it triggers an alarm string 10 no
content_based_deduplication Enables content-based deduplication for FIFO queues bool false no
email Email of the SNS topic for alarm notifactions string "" no
fifo_queue Boolean designating a FIFO queue bool false no
kms_data_key_reuse_period_seconds 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. An integer representing seconds, between 60 seconds (1 minute) and 86,400 seconds (24 hours) number 300 no
kms_master_key_id The ID of an AWS-managed customer master key (CMK) for Amazon SQS or a custom CMK string "" no
kms_master_key_id_sns The ID of an AWS-managed customer master key (CMK) for Amazon SNS or a custom CMK string "" no
max_message_size The limit of how many bytes a message can contain before Amazon SQS rejects it. An integer from 1024 bytes (1 KiB) up to 262144 bytes (256 KiB) number 262144 no
message_retention_seconds The number of seconds Amazon SQS retains a message. Integer representing seconds, from 60 (1 minute) to 1209600 (14 days) number 345600 no
name This is the human-readable name of the queue. If omitted, Terraform will assign a random name. string n/a yes
policy_deadletter_queue A Policy custom of AWS account IDs allowed to access this resource string "" no
policy_queue A Policy custom of AWS account IDs allowed to access this resource string "" no
tags A mapping of tags to assign to all resources map(string) {} no
visibility_timeout_seconds The visibility timeout for the queue. An integer from 0 to 43200 (12 hours) number 30 no

Outputs

No outputs.

About

Terraform Module for creating an SQS queue and an accompanying dead letter queue (dlq).

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages