Infra & Cloud
terraform
Intermediate
AWS SQS Queue with DLQ
Terraform for an SQS queue with a dead-letter queue for failed message handling.
terraform
resource "aws_sqs_queue" "dlq" {
name = "${var.name}-dlq"
message_retention_seconds = 1209600
}
resource "aws_sqs_queue" "main" {
name = var.name
visibility_timeout_seconds = 30
redrive_policy = jsonencode({
deadLetterTargetArn = aws_sqs_queue.dlq.arn
maxReceiveCount = 5
})
}
Prerequisites
- terraform >= 1.0
- AWS provider
Pro Tips
- → Set CloudWatch alarm on dlq ApproximateNumberOfMessages.
Commercial Licensing
Acquire a production access token or template license for enterprise deployment.
Module Info
- Language
- terraform
- Level
- Intermediate
- Read time
- 3 min
- Published
- Nov 2025
- License
- Commercial License
Newsletter
New modules every week, directly to your inbox.
Similar Modules
AWS S3 Static Website
Terraform module to provision an S3 bucket for static website hosting.
terraform
·
Intermediate
AWS RDS Postgres Terraform
Terraform resource for an RDS PostgreSQL instance with encryption and backup.
terraform
·
Intermediate
ECS Task Force Stop
Force-stop all running ECS tasks in a service for emergency rollback.
bash
·
Intermediate