diff --git a/infrastructure/terraform/modules/lambda/README.md b/infrastructure/terraform/modules/lambda/README.md index 84dca0b4..5f30a6d8 100644 --- a/infrastructure/terraform/modules/lambda/README.md +++ b/infrastructure/terraform/modules/lambda/README.md @@ -76,6 +76,7 @@ output "processor_lambda_error_rate_alarm_arn" { | [permission\_statements](#input\_permission\_statements) | Statements giving an external source permission to invoke the Lambda function |
list(object({
action = optional(string)
principal = string
source_arn = optional(string)
source_account = optional(string)
statement_id = string
}))
| `[]` | no | | [project](#input\_project) | The name of the tfscaffold project | `string` | n/a | yes | | [region](#input\_region) | The AWS Region | `string` | n/a | yes | +| [reserved\_concurrent\_executions](#input\_reserved\_concurrent\_executions) | The reserved concurrency for the Lambda function. Set to -1 to remove the concurrency limit, or 0 to prevent the Lambda from being invoked. | `number` | `-1` | no | | [runtime](#input\_runtime) | The runtime to use for the lambda function | `string` | `null` | no | | [schedule](#input\_schedule) | The fully qualified Cloudwatch Events schedule for when to run the lambda function, e.g. rate(1 day) or a cron() expression. Default disables all events resources | `string` | `""` | no | | [send\_to\_firehose](#input\_send\_to\_firehose) | Enable sending logs to firehose | `bool` | `true` | no | diff --git a/infrastructure/terraform/modules/lambda/lambda_function.tf b/infrastructure/terraform/modules/lambda/lambda_function.tf index 7b5662ed..f00e777d 100644 --- a/infrastructure/terraform/modules/lambda/lambda_function.tf +++ b/infrastructure/terraform/modules/lambda/lambda_function.tf @@ -9,6 +9,8 @@ resource "aws_lambda_function" "main" { memory_size = var.memory timeout = var.timeout + reserved_concurrent_executions = var.reserved_concurrent_executions + s3_bucket = local.package_type == "zip" ? aws_s3_object.lambda[0].bucket : null s3_key = local.package_type == "zip" ? aws_s3_object.lambda[0].key : null s3_object_version = local.package_type == "zip" ? aws_s3_object.lambda[0].version_id : null diff --git a/infrastructure/terraform/modules/lambda/variables.tf b/infrastructure/terraform/modules/lambda/variables.tf index c4b488cd..a39fe109 100644 --- a/infrastructure/terraform/modules/lambda/variables.tf +++ b/infrastructure/terraform/modules/lambda/variables.tf @@ -394,3 +394,9 @@ variable "permission_statements" { description = "Statements giving an external source permission to invoke the Lambda function" default = [] } + +variable "reserved_concurrent_executions" { + type = number + description = "The reserved concurrency for the Lambda function. Set to -1 to remove the concurrency limit, or 0 to prevent the Lambda from being invoked." + default = -1 +}