Skip to content

Commit fb231f9

Browse files
CCM-12858: WIP fixes
1 parent 69137ea commit fb231f9

File tree

5 files changed

+44
-2
lines changed

5 files changed

+44
-2
lines changed

infrastructure/terraform/components/dl/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ No requirements.
4545
| <a name="module_s3bucket_letters"></a> [s3bucket\_letters](#module\_s3bucket\_letters) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.24/terraform-s3bucket.zip | n/a |
4646
| <a name="module_s3bucket_static_assets"></a> [s3bucket\_static\_assets](#module\_s3bucket\_static\_assets) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.24/terraform-s3bucket.zip | n/a |
4747
| <a name="module_sqs_core_notifier"></a> [sqs\_core\_notifier](#module\_sqs\_core\_notifier) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.24/terraform-sqs.zip | n/a |
48+
| <a name="module_sqs_core_notifier_errors"></a> [sqs\_core\_notifier\_errors](#module\_sqs\_core\_notifier\_errors) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.24/terraform-sqs.zip | n/a |
4849
| <a name="module_sqs_event_publisher_errors"></a> [sqs\_event\_publisher\_errors](#module\_sqs\_event\_publisher\_errors) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.24/terraform-sqs.zip | n/a |
4950
| <a name="module_sqs_ttl"></a> [sqs\_ttl](#module\_sqs\_ttl) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.24/terraform-sqs.zip | n/a |
5051
| <a name="module_sqs_ttl_handle_expiry_errors"></a> [sqs\_ttl\_handle\_expiry\_errors](#module\_sqs\_ttl\_handle\_expiry\_errors) | https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.24/terraform-sqs.zip | n/a |
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
resource "aws_lambda_event_source_mapping" "core_notifier_lambda" {
2+
event_source_arn = module.sqs_core_notifier.sqs_queue_arn
3+
function_name = module.core_notifier.function_arn
4+
starting_position = "TRIM_HORIZON"
5+
batch_size = 50
6+
maximum_batching_window_in_seconds = 10
7+
maximum_retry_attempts = 3
8+
9+
function_response_types = [
10+
"ReportBatchItemFailures"
11+
]
12+
13+
destination_config {
14+
on_failure {
15+
destination_arn = module.sqs_core_notifier_errors.sqs_queue_arn
16+
}
17+
}
18+
19+
filter_criteria {
20+
filter {
21+
pattern = jsonencode({
22+
eventName : ["REMOVE"]
23+
})
24+
}
25+
}
26+
}

infrastructure/terraform/components/dl/module_lambda_core_notifier.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ data "aws_iam_policy_document" "core_notifier_lambda" {
103103
}
104104

105105
statement {
106-
sid = "SQSPermissionsEventPublisherDLQ"
106+
sid = "SQSPermissionsDLQ"
107107
effect = "Allow"
108108

109109
actions = [
@@ -112,6 +112,7 @@ data "aws_iam_policy_document" "core_notifier_lambda" {
112112
]
113113

114114
resources = [
115+
module.sqs_core_notifier_errors.sqs_queue_arn,
115116
module.sqs_event_publisher_errors.sqs_queue_arn,
116117
]
117118
}

infrastructure/terraform/components/dl/module_sqs_core_notifier.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module "sqs_core_notifier" {
66
environment = var.environment
77
project = var.project
88
region = var.region
9-
name = "core-notifier"
9+
name = "core"
1010

1111
sqs_kms_key_arn = module.kms.key_arn
1212

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module "sqs_core_notifier_errors" {
2+
source = "https://github.com/NHSDigital/nhs-notify-shared-modules/releases/download/v2.0.24/terraform-sqs.zip"
3+
4+
aws_account_id = var.aws_account_id
5+
component = local.component
6+
environment = var.environment
7+
project = var.project
8+
region = var.region
9+
name = "core_notifier-errors"
10+
11+
sqs_kms_key_arn = module.kms.key_arn
12+
13+
visibility_timeout_seconds = 60
14+
}

0 commit comments

Comments
 (0)