generated from NHSDigital/nhs-notify-repository-template
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmodule_sqs_print_status_handler.tf
More file actions
41 lines (35 loc) · 1.25 KB
/
module_sqs_print_status_handler.tf
File metadata and controls
41 lines (35 loc) · 1.25 KB
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
32
33
34
35
36
37
38
39
40
41
module "sqs_print_status_handler" {
source = "https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/3.0.6/terraform-sqs.zip"
aws_account_id = var.aws_account_id
component = local.component
environment = var.environment
project = var.project
region = var.region
name = "print-status-handler"
sqs_kms_key_arn = module.kms.key_arn
visibility_timeout_seconds = var.sqs_visibility_timeout_seconds
create_dlq = true
max_receive_count = 1
sqs_policy_overload = data.aws_iam_policy_document.sqs_print_status_handler.json
}
data "aws_iam_policy_document" "sqs_print_status_handler" {
statement {
sid = "AllowEventBridgeToSendMessage"
effect = "Allow"
principals {
type = "Service"
identifiers = ["events.amazonaws.com"]
}
actions = [
"sqs:SendMessage"
]
resources = [
"arn:aws:sqs:${var.region}:${var.aws_account_id}:${local.csi}-print-status-handler-queue"
]
condition {
test = "ArnEquals"
variable = "aws:SourceArn"
values = [aws_cloudwatch_event_rule.print_status_changed.arn]
}
}
}