-
Notifications
You must be signed in to change notification settings - Fork 7
/
sqs1.tf
31 lines (25 loc) · 1.13 KB
/
sqs1.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 {
sqs1_name = length(var.sqs1_name_override) > 0 ? var.sqs1_name_override : join("-", [var.name, "1"])
}
module "sqs1" {
source = "terraform-aws-modules/sqs/aws"
version = "3.4.1"
create = var.sqs1_enabled ? "true" : "false"
name = local.sqs1_name
delay_seconds = var.sqs1_delay_seconds
fifo_queue = var.sqs1_fifo_queue
max_message_size = var.sqs1_max_message_size
receive_wait_time_seconds = var.sqs1_receive_wait_time_seconds
redrive_policy = var.sqs1_dlq_enabled ? "{\"deadLetterTargetArn\":\"${module.sqs1-dlq.sqs_queue_arn}\",\"maxReceiveCount\":4}" : var.sqs1_redrive_policy
visibility_timeout_seconds = var.sqs1_visibility_timeout_seconds
}
module "sqs1-dlq" {
source = "terraform-aws-modules/sqs/aws"
version = "3.4.1"
create = var.sqs1_dlq_enabled ? "true" : "false"
name = "${local.sqs1_name}-deadletter"
delay_seconds = var.sqs1_delay_seconds
max_message_size = var.sqs1_max_message_size
receive_wait_time_seconds = var.sqs1_receive_wait_time_seconds
visibility_timeout_seconds = var.sqs1_visibility_timeout_seconds
}