Skip to content

Commit

Permalink
Fix to work with queues without dlq
Browse files Browse the repository at this point in the history
  • Loading branch information
snemetz committed Jan 24, 2019
1 parent c6a0b87 commit 777f750
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions examples/queues-without-dlq/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ module "example" {
source = "../../"
sqs_queues = ["queue01", "queue02"]
environment = "testing"
enable_dlq = false
}
12 changes: 11 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
Binary file modified resource-plan-graph.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 777f750

Please sign in to comment.