handler
RequiredFunction entrypoint in your code
Example
handler = example-valueHandler Formats by Runtime
The handler format varies depending on your Lambda runtime:
| Runtime | Format | Example |
|---|---|---|
| Python | module.function | main.handler |
| Node.js | file.function | index.handler |
| Go | Binary name | bootstrap |
| Java | package.Class::method | com.example.Handler::handleRequest |
| .NET | Assembly::Namespace.Class::Method | MyApp::MyNamespace.Function::Handler |
Best Practices
- Keep the handler function name consistent across your codebase
- Use
handleras 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
}