Comprehensive developer toolkit implementing serverless best practices for AWS Lambda functions in Python
89
A Lambda function that processes user requests and generates structured logs with automatic context enrichment.
@generates
def lambda_handler(event: dict, context) -> dict:
"""
Process user requests with automatic Lambda context logging.
Args:
event: Dictionary containing 'userId' (str) and 'action' (str)
context: Lambda context object
Returns:
Dictionary with 'statusCode' (200), and 'body' containing 'userId' and 'action'
Raises:
ValueError: If userId is missing from event
"""
passProvides structured logging with automatic Lambda context injection.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/pypi-aws-lambda-powertoolsdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10