Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions infrastructure/terraform/components/dl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ No requirements.
| <a name="input_force_lambda_code_deploy"></a> [force\_lambda\_code\_deploy](#input\_force\_lambda\_code\_deploy) | If the lambda package in s3 has the same commit id tag as the terraform build branch, the lambda will not update automatically. Set to True if making changes to Lambda code from on the same commit for example during development | `bool` | `false` | no |
| <a name="input_group"></a> [group](#input\_group) | The group variables are being inherited from (often synonmous with account short-name) | `string` | n/a | yes |
| <a name="input_kms_deletion_window"></a> [kms\_deletion\_window](#input\_kms\_deletion\_window) | When a kms key is deleted, how long should it wait in the pending deletion state? | `string` | `"30"` | no |
| <a name="input_lambda_timeout_seconds"></a> [lambda\_timeout\_seconds](#input\_lambda\_timeout\_seconds) | The timeout of the lambdas that are triggered by SQS. | `string` | `"45"` | no |
| <a name="input_log_level"></a> [log\_level](#input\_log\_level) | The log level to be used in lambda functions within the component. Any log with a lower severity than the configured value will not be logged: https://docs.python.org/3/library/logging.html#levels | `string` | `"INFO"` | no |
| <a name="input_log_retention_in_days"></a> [log\_retention\_in\_days](#input\_log\_retention\_in\_days) | The retention period in days for the Cloudwatch Logs events to be retained, default of 0 is indefinite | `number` | `0` | no |
| <a name="input_mesh_poll_schedule"></a> [mesh\_poll\_schedule](#input\_mesh\_poll\_schedule) | Schedule to poll MESH for messages | `string` | `"rate(5 minutes)"` | no |
Expand All @@ -55,6 +56,7 @@ No requirements.
| <a name="input_shared_infra_account_id"></a> [shared\_infra\_account\_id](#input\_shared\_infra\_account\_id) | The AWS Shared Infra Account ID (numeric) | `string` | n/a | yes |
| <a name="input_sns_success_logging_sample_percent"></a> [sns\_success\_logging\_sample\_percent](#input\_sns\_success\_logging\_sample\_percent) | Enable SNS Delivery Successful Sample Percentage | `number` | `0` | no |
| <a name="input_sqs_max_receive_count"></a> [sqs\_max\_receive\_count](#input\_sqs\_max\_receive\_count) | Maximum number of times a message can be received before being sent to the DLQ | `string` | `"3"` | no |
| <a name="input_sqs_visibility_timeout_seconds"></a> [sqs\_visibility\_timeout\_seconds](#input\_sqs\_visibility\_timeout\_seconds) | The visibility timeout of the SQS queues. AWS recommends this timeout to be at least 6 times the function timeout (lambda\_timeout\_seconds), see https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-lambda-function-trigger.html | `string` | `"270"` | no |
| <a name="input_ttl_poll_schedule"></a> [ttl\_poll\_schedule](#input\_ttl\_poll\_schedule) | Schedule to poll for any overdue TTL records | `string` | `"rate(10 minutes)"` | no |
## Modules

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ module "lambda_lambda_apim_refresh_token" {
function_include_common = true
handler_function_name = "handler"
runtime = "nodejs22.x"
memory = 128
timeout = 5
memory = 256
timeout = var.lambda_timeout_seconds
log_level = var.log_level
schedule = var.apim_auth_token_schedule

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ module "core_notifier" {
function_include_common = true
handler_function_name = "handler"
runtime = "nodejs22.x"
memory = 128
timeout = 60
memory = 256
timeout = var.lambda_timeout_seconds
log_level = var.log_level

force_lambda_code_deploy = var.force_lambda_code_deploy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ module "file_scanner" {
function_include_common = true
handler_function_name = "handler"
runtime = "nodejs22.x"
memory = 512
timeout = 60
memory = 256
timeout = var.lambda_timeout_seconds
log_level = var.log_level

force_lambda_code_deploy = var.force_lambda_code_deploy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ module "mesh_acknowledge" {
function_module_name = "mesh_acknowledge"
handler_function_name = "handler.handler"
runtime = "python3.14"
memory = 128
timeout = 5
memory = 256
timeout = var.lambda_timeout_seconds
log_level = var.log_level

force_lambda_code_deploy = var.force_lambda_code_deploy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module "mesh_download" {
handler_function_name = "handler.handler"
runtime = "python3.14"
memory = 256
timeout = 60
timeout = var.lambda_timeout_seconds
log_level = var.log_level

force_lambda_code_deploy = var.force_lambda_code_deploy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module "mesh_poll" {
function_module_name = "mesh_poll"
handler_function_name = "handler.handler"
runtime = "python3.14"
memory = 128
memory = 256
timeout = 300
log_level = var.log_level
schedule = var.mesh_poll_schedule
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ module "move_scanned_files" {
function_include_common = true
handler_function_name = "handler"
runtime = "nodejs22.x"
memory = 128
timeout = 60
memory = 256
timeout = var.lambda_timeout_seconds
log_level = var.log_level

force_lambda_code_deploy = var.force_lambda_code_deploy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module "pdm_mock" {
function_include_common = true
handler_function_name = "handler"
runtime = "nodejs22.x"
memory = 128
memory = 256
timeout = 30
log_level = var.log_level

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ module "pdm_poll" {
function_include_common = true
handler_function_name = "handler"
runtime = "nodejs22.x"
memory = 128
timeout = 60
memory = 256
timeout = var.lambda_timeout_seconds
log_level = var.log_level

force_lambda_code_deploy = var.force_lambda_code_deploy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ module "pdm_uploader" {
function_include_common = true
handler_function_name = "handler"
runtime = "nodejs22.x"
memory = 128
timeout = 60
memory = 256
timeout = var.lambda_timeout_seconds
log_level = var.log_level

force_lambda_code_deploy = var.force_lambda_code_deploy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ module "print_analyser" {
function_include_common = true
handler_function_name = "handler"
runtime = "nodejs22.x"
memory = 128
timeout = 60
memory = 256
timeout = var.lambda_timeout_seconds
log_level = var.log_level

force_lambda_code_deploy = var.force_lambda_code_deploy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ module "print_sender" {
function_include_common = true
handler_function_name = "handler"
runtime = "nodejs22.x"
memory = 128
timeout = 60
memory = 256
timeout = var.lambda_timeout_seconds
log_level = var.log_level

force_lambda_code_deploy = var.force_lambda_code_deploy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ module "print_status_handler" {
function_include_common = true
handler_function_name = "handler"
runtime = "nodejs22.x"
memory = 128
timeout = 60
memory = 256
timeout = var.lambda_timeout_seconds
log_level = var.log_level

force_lambda_code_deploy = var.force_lambda_code_deploy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ module "report_event_transformer" {
function_include_common = true
handler_function_name = "handler"
runtime = "nodejs22.x"
memory = 128
timeout = 60
memory = 256
timeout = var.lambda_timeout_seconds
log_level = var.log_level

force_lambda_code_deploy = var.force_lambda_code_deploy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module "report_generator" {
function_include_common = true
handler_function_name = "handler"
runtime = "nodejs22.x"
memory = 128
memory = 256
timeout = 60
log_level = var.log_level

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ module "report_scheduler" {
function_include_common = true
handler_function_name = "handler"
runtime = "nodejs22.x"
memory = 128
timeout = 360
memory = 256
timeout = var.lambda_timeout_seconds
log_level = var.log_level
schedule = var.report_scheduler_schedule

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ module "report_sender" {
function_module_name = "report_sender"
handler_function_name = "handler.handler"
runtime = "python3.14"
memory = 128
timeout = 5
memory = 256
timeout = var.lambda_timeout_seconds
log_level = var.log_level

force_lambda_code_deploy = var.force_lambda_code_deploy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ module "ttl_create" {
function_include_common = true
handler_function_name = "handler"
runtime = "nodejs22.x"
memory = 128
timeout = 60
memory = 256
timeout = var.lambda_timeout_seconds
log_level = var.log_level

force_lambda_code_deploy = var.force_lambda_code_deploy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ module "ttl_handle_expiry" {
function_include_common = true
handler_function_name = "handler"
runtime = "nodejs22.x"
memory = 128
timeout = 360
memory = 256
timeout = var.lambda_timeout_seconds
log_level = var.log_level

force_lambda_code_deploy = var.force_lambda_code_deploy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ module "ttl_poll" {
function_include_common = true
handler_function_name = "handler"
runtime = "nodejs22.x"
memory = 128
timeout = 360
memory = 256
timeout = var.lambda_timeout_seconds
log_level = var.log_level
schedule = var.ttl_poll_schedule

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module "sqs_core_notifier" {
region = var.region
name = "core-notifier"
sqs_kms_key_arn = module.kms.key_arn
visibility_timeout_seconds = 60
visibility_timeout_seconds = var.sqs_visibility_timeout_seconds
create_dlq = true
max_receive_count = var.sqs_max_receive_count
sqs_policy_overload = data.aws_iam_policy_document.sqs_inbound_event.json
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ module "sqs_event_publisher_errors" {

sqs_kms_key_arn = module.kms.key_arn

visibility_timeout_seconds = 60
visibility_timeout_seconds = var.sqs_visibility_timeout_seconds
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module "sqs_mesh_acknowledge" {
region = var.region
name = "mesh-acknowledge"
sqs_kms_key_arn = module.kms.key_arn
visibility_timeout_seconds = 60
visibility_timeout_seconds = var.sqs_visibility_timeout_seconds
create_dlq = true
max_receive_count = var.sqs_max_receive_count
sqs_policy_overload = data.aws_iam_policy_document.sqs_mesh_acknowledge.json
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module "sqs_mesh_download" {
region = var.region
name = "mesh-download"
sqs_kms_key_arn = module.kms.key_arn
visibility_timeout_seconds = 60
visibility_timeout_seconds = var.sqs_visibility_timeout_seconds
create_dlq = true
max_receive_count = var.sqs_max_receive_count
sqs_policy_overload = data.aws_iam_policy_document.sqs_mesh_download.json
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module "sqs_move_scanned_files" {
region = var.region
name = "move-scanned-files"
sqs_kms_key_arn = module.kms.key_arn
visibility_timeout_seconds = 60
visibility_timeout_seconds = var.sqs_visibility_timeout_seconds
create_dlq = true
max_receive_count = var.sqs_max_receive_count
sqs_policy_overload = data.aws_iam_policy_document.sqs_move_scanned_files.json
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module "sqs_pdm_poll" {
region = var.region
name = "pdm-poll"
sqs_kms_key_arn = module.kms.key_arn
visibility_timeout_seconds = 60
visibility_timeout_seconds = var.sqs_visibility_timeout_seconds
delay_seconds = 5
create_dlq = true
max_receive_count = var.sqs_max_receive_count
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module "sqs_pdm_uploader" {
region = var.region
name = "pdm-uploader"
sqs_kms_key_arn = module.kms.key_arn
visibility_timeout_seconds = 60
visibility_timeout_seconds = var.sqs_visibility_timeout_seconds
create_dlq = true
max_receive_count = var.sqs_max_receive_count

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ module "sqs_print_analyser" {
region = var.region
name = "print-analyser"
sqs_kms_key_arn = module.kms.key_arn
visibility_timeout_seconds = 60
delay_seconds = 5
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_analyser.json
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module "sqs_print_sender" {
region = var.region
name = "print-sender"
sqs_kms_key_arn = module.kms.key_arn
visibility_timeout_seconds = 60
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_sender.json
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ module "sqs_print_status_handler" {
region = var.region
name = "print-status-handler"
sqs_kms_key_arn = module.kms.key_arn
visibility_timeout_seconds = 60
delay_seconds = 5
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module "sqs_report_generator" {

sqs_kms_key_arn = module.kms.key_arn

visibility_timeout_seconds = 60
visibility_timeout_seconds = var.sqs_visibility_timeout_seconds

create_dlq = true

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module "sqs_report_sender" {
region = var.region
name = "report-sender"
sqs_kms_key_arn = module.kms.key_arn
visibility_timeout_seconds = 60
visibility_timeout_seconds = var.sqs_visibility_timeout_seconds
create_dlq = true
max_receive_count = var.sqs_max_receive_count
sqs_policy_overload = data.aws_iam_policy_document.sqs_report_sender.json
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module "sqs_scanner" {
region = var.region
name = "file-scanner"
sqs_kms_key_arn = module.kms.key_arn
visibility_timeout_seconds = 60
visibility_timeout_seconds = var.sqs_visibility_timeout_seconds
delay_seconds = 0
create_dlq = true
max_receive_count = var.sqs_max_receive_count
Expand Down
2 changes: 1 addition & 1 deletion infrastructure/terraform/components/dl/module_sqs_ttl.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module "sqs_ttl" {
region = var.region
name = "ttl"
sqs_kms_key_arn = module.kms.key_arn
visibility_timeout_seconds = 60
visibility_timeout_seconds = var.sqs_visibility_timeout_seconds
create_dlq = true
max_receive_count = var.sqs_max_receive_count
sqs_policy_overload = data.aws_iam_policy_document.sqs_ttl.json
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ module "sqs_ttl_handle_expiry_errors" {

sqs_kms_key_arn = module.kms.key_arn

visibility_timeout_seconds = 60
visibility_timeout_seconds = var.sqs_visibility_timeout_seconds
}
12 changes: 12 additions & 0 deletions infrastructure/terraform/components/dl/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,18 @@ variable "sqs_max_receive_count" {
default = "3"
}

variable "sqs_visibility_timeout_seconds" {
type = string
description = "The visibility timeout of the SQS queues. AWS recommends this timeout to be at least 6 times the function timeout (lambda_timeout_seconds), see https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-lambda-function-trigger.html"
default = "270"
}

variable "lambda_timeout_seconds" {
type = string
description = "The timeout of the lambdas that are triggered by SQS. "
default = "45"
}

variable "enable_event_cache" {
type = bool
description = "Enable caching of events to an S3 bucket"
Expand Down
Loading