-
Notifications
You must be signed in to change notification settings - Fork 7
/
sqs4.tf
31 lines (25 loc) · 1.13 KB
/
sqs4.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
locals {
sqs4_name = length(var.sqs4_name_override) > 0 ? var.sqs4_name_override : join("-", [var.name, "4"])
}
module "sqs4" {
source = "terraform-aws-modules/sqs/aws"
version = "3.4.1"
create = var.sqs4_enabled ? "true" : "false"
name = local.sqs4_name
delay_seconds = var.sqs4_delay_seconds
fifo_queue = var.sqs4_fifo_queue
max_message_size = var.sqs4_max_message_size
receive_wait_time_seconds = var.sqs4_receive_wait_time_seconds
redrive_policy = var.sqs4_dlq_enabled ? "{\"deadLetterTargetArn\":\"${module.sqs4-dlq.sqs_queue_arn}\",\"maxReceiveCount\":4}" : var.sqs4_redrive_policy
visibility_timeout_seconds = var.sqs4_visibility_timeout_seconds
}
module "sqs4-dlq" {
source = "terraform-aws-modules/sqs/aws"
version = "3.4.1"
create = var.sqs4_dlq_enabled ? "true" : "false"
name = "${local.sqs4_name}-deadletter"
delay_seconds = var.sqs4_delay_seconds
max_message_size = var.sqs4_max_message_size
receive_wait_time_seconds = var.sqs4_receive_wait_time_seconds
visibility_timeout_seconds = var.sqs4_visibility_timeout_seconds
}