timeout

Type number
Default 30

Maximum execution time in seconds

Example

timeout = 30

Timeout Limits

  • Minimum: 1 second
  • Maximum: 900 seconds (15 minutes)
  • Default: 30 seconds

Integration Considerations

TriggerTimeout Limit
API Gateway (REST)29 seconds
API Gateway (HTTP)30 seconds
ALB900 seconds
S3900 seconds
SQS900 seconds
EventBridge900 seconds

Best Practices

  • Set timeouts based on expected execution time plus buffer
  • For API Gateway, keep under 29 seconds
  • Use Step Functions for long-running workflows
  • Monitor timeout errors in CloudWatch

Full Module Example

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

  # timeout
  timeout = 30

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