tessl install tessl/pypi-aws-lambda-powertools@3.19.0Comprehensive developer toolkit implementing serverless best practices for AWS Lambda functions in Python
Agent Success
Agent success rate when using this tile
89%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.22x
Baseline
Agent success rate without this tile
73%
Build a simple user profile management service that exposes HTTP endpoints via AWS Lambda Function URLs.
Implement a Lambda function that handles HTTP requests for managing user profiles. The service should:
GET /users/<user_id> - Retrieve a user profile by ID
POST /users - Create a new user profile
PUT /users/<user_id> - Update an existing user profile
CORS Support - Enable CORS for all endpoints
Error Handling - Handle validation errors gracefully
@generates
def lambda_handler(event: dict, context) -> dict:
"""
Lambda handler for processing Function URL requests.
Parameters:
- event: Lambda Function URL event
- context: Lambda runtime context
Returns:
Lambda Function URL response dictionary
"""Provides event handler support for Lambda Function URLs.