diff --git a/main.tf b/main.tf index ca83523285..be29d2a5ef 100644 --- a/main.tf +++ b/main.tf @@ -224,6 +224,7 @@ module "runners" { lambda_runtime = var.lambda_runtime lambda_architecture = var.lambda_architecture lambda_event_source_mapping_batch_size = var.lambda_event_source_mapping_batch_size + enable_scale_up_event_source_mapping = var.enable_scale_up_event_source_mapping lambda_event_source_mapping_maximum_batching_window_in_seconds = var.lambda_event_source_mapping_maximum_batching_window_in_seconds lambda_zip = var.runners_lambda_zip lambda_scale_up_memory_size = var.runners_scale_up_lambda_memory_size diff --git a/modules/runners/scale-up.tf b/modules/runners/scale-up.tf index bdda3c070f..368331c957 100644 --- a/modules/runners/scale-up.tf +++ b/modules/runners/scale-up.tf @@ -98,6 +98,7 @@ resource "aws_lambda_event_source_mapping" "scale_up" { function_response_types = ["ReportBatchItemFailures"] batch_size = var.lambda_event_source_mapping_batch_size maximum_batching_window_in_seconds = var.lambda_event_source_mapping_maximum_batching_window_in_seconds + enabled = var.enable_scale_up_event_source_mapping tags = var.tags } diff --git a/modules/runners/variables.tf b/modules/runners/variables.tf index 08283ce65c..c94fefed8b 100644 --- a/modules/runners/variables.tf +++ b/modules/runners/variables.tf @@ -855,6 +855,12 @@ variable "lambda_event_source_mapping_batch_size" { } } +variable "enable_scale_up_event_source_mapping" { + description = "Enable the SQS event source mapping that invokes the scale-up lambda. Disable to drive scale-up from an external consumer of the build queue, for example a rate limiter that paces CreateFleet calls. When disabled, nothing consumes the build queue unless you provide your own consumer." + type = bool + default = true +} + variable "lambda_event_source_mapping_maximum_batching_window_in_seconds" { description = "Maximum amount of time to gather records before invoking the lambda function, in seconds. AWS requires this to be greater than 0 if batch_size is greater than 10. Defaults to 0." type = number diff --git a/variables.tf b/variables.tf index 4af2ab4cd1..e1831f93a8 100644 --- a/variables.tf +++ b/variables.tf @@ -1152,6 +1152,12 @@ variable "lambda_event_source_mapping_batch_size" { default = 10 } +variable "enable_scale_up_event_source_mapping" { + description = "Enable the SQS event source mapping that invokes the scale-up lambda. Disable to drive scale-up from an external consumer of the build queue, for example a rate limiter that paces CreateFleet calls. When disabled, nothing consumes the build queue unless you provide your own consumer." + type = bool + default = true +} + variable "lambda_event_source_mapping_maximum_batching_window_in_seconds" { description = "Maximum amount of time to gather records before invoking the lambda function, in seconds. AWS requires this to be greater than 0 if batch_size is greater than 10. Defaults to 0." type = number