diff --git a/examples/queues-without-dlq/main.tf b/examples/queues-without-dlq/main.tf index 400de43..0ee6e0d 100644 --- a/examples/queues-without-dlq/main.tf +++ b/examples/queues-without-dlq/main.tf @@ -2,4 +2,5 @@ module "example" { source = "../../" sqs_queues = ["queue01", "queue02"] environment = "testing" + enable_dlq = false } diff --git a/main.tf b/main.tf index 23dadb2..acd02cd 100644 --- a/main.tf +++ b/main.tf @@ -48,7 +48,17 @@ resource "aws_sqs_queue" "queue_deadletter" { } resource "aws_sqs_queue" "queue" { - count = "${module.enable.value ? length(module.labels.id) : 0}" + count = "${module.enable.value && ! module.enable_dlq.value ? length(module.labels.id) : 0}" + name = "${module.labels.id[count.index]}" + delay_seconds = "${var.delay_seconds}" + max_message_size = "${var.max_message_size}" + message_retention_seconds = "${var.message_retention_seconds}" + visibility_timeout_seconds = "${var.visibility_timeout_seconds}" + tags = "${module.labels.tags[count.index]}" +} + +resource "aws_sqs_queue" "queue_with_dlq" { + count = "${module.enable.value && module.enable_dlq.value ? length(module.labels.id) : 0}" name = "${module.labels.id[count.index]}" delay_seconds = "${var.delay_seconds}" max_message_size = "${var.max_message_size}" diff --git a/resource-plan-graph.png b/resource-plan-graph.png index 6b19d3c..061cd78 100644 Binary files a/resource-plan-graph.png and b/resource-plan-graph.png differ