-
Notifications
You must be signed in to change notification settings - Fork 7
/
sqs2.tf
31 lines (25 loc) · 1.13 KB
/
sqs2.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 {
sqs2_name = length(var.sqs2_name_override) > 0 ? var.sqs2_name_override : join("-", [var.name, "2"])
}
module "sqs2" {
source = "terraform-aws-modules/sqs/aws"
version = "3.4.1"
create = var.sqs2_enabled ? "true" : "false"
name = local.sqs2_name
delay_seconds = var.sqs2_delay_seconds
fifo_queue = var.sqs2_fifo_queue
max_message_size = var.sqs2_max_message_size
receive_wait_time_seconds = var.sqs2_receive_wait_time_seconds
redrive_policy = var.sqs2_dlq_enabled ? "{\"deadLetterTargetArn\":\"${module.sqs2-dlq.sqs_queue_arn}\",\"maxReceiveCount\":4}" : var.sqs2_redrive_policy
visibility_timeout_seconds = var.sqs2_visibility_timeout_seconds
}
module "sqs2-dlq" {
source = "terraform-aws-modules/sqs/aws"
version = "3.4.1"
create = var.sqs2_dlq_enabled ? "true" : "false"
name = "${local.sqs2_name}-deadletter"
delay_seconds = var.sqs2_delay_seconds
max_message_size = var.sqs2_max_message_size
receive_wait_time_seconds = var.sqs2_receive_wait_time_seconds
visibility_timeout_seconds = var.sqs2_visibility_timeout_seconds
}