handler

Required
Type string

Function entrypoint in your code

Example

handler = example-value

Handler Formats by Runtime

The handler format varies depending on your Lambda runtime:

RuntimeFormatExample
Pythonmodule.functionmain.handler
Node.jsfile.functionindex.handler
GoBinary namebootstrap
Javapackage.Class::methodcom.example.Handler::handleRequest
.NETAssembly::Namespace.Class::MethodMyApp::MyNamespace.Function::Handler

Best Practices

  • Keep the handler function name consistent across your codebase
  • Use handler as the function name for simplicity
  • Organize code with the handler as a thin entry point
  • Delegate business logic to separate modules

Full Module Example

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

  # handler
  handler = example-value

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