reserved_concurrent_executions

Type number
Default -1

Reserved concurrency limit for the function. Use -1 for no limit, 0 to disable.

Example

reserved_concurrent_executions = -1

Concurrency Values

ValueBehavior
-1No reserved concurrency (default)
0Function is disabled
1+Reserved concurrent executions

Use Cases

  • Rate limiting: Protect downstream resources
  • Cost control: Limit execution costs
  • Throttling: Control function invocation rate
  • Disable function: Set to 0 for maintenance

Best Practices

  • Monitor Throttles metric in CloudWatch
  • Set reserved concurrency for functions with database connections
  • Leave some unreserved concurrency for other functions
  • Use provisioned concurrency for latency-sensitive workloads

Full Module Example

module "lambda_function" {
  source  = "registry.patterneddesigns.ca/patterneddesigns/lambda-function/aws"
  version = "0.1.0"

  # reserved_concurrent_executions
  reserved_concurrent_executions = -1

  # Other required inputs
  function_name = my-resource
  runtime = python3.9
  handler = example-value
  source_path = /path/to/resource
}