
Aws Lambda Python Integration
Scaffold and extend AWS Lambda HTTP APIs in Python with AWS Chalice—routing, project layout, local dev, and deploy patterns.
Overview
AWS Lambda Python Integration is an agent skill for the Build phase that teaches AWS Chalice patterns to create, route, and deploy Python Lambda APIs behind API Gateway.
Install
npx skills add https://github.com/giuseppe-trisciuoglio/developer-kit --skill aws-lambda-python-integrationWhat is this skill?
- End-to-end Chalice project layout with app.py, .chalice/config.json, and chalicelib modules
- Decorator-based GET/POST routing similar to Flask
- pip install chalice and chalice new-project bootstrap commands
- Automatic IAM policy generation and built-in CORS called out in overview
- Local development server and API Gateway deployment path
Adoption & trust: 1k installs on skills.sh; 271 GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You need a Python serverless API on Lambda but lack a consistent Chalice project structure and routing examples for your agent.
Who is it for?
Indie developers choosing Chalice for small APIs, webhooks, or internal tools on AWS Lambda.
Skip if: Teams committed to containerized Lambda, Terraform-only IaC without Chalice, or non-Python runtimes.
When should I use this skill?
You are implementing or extending AWS Lambda HTTP handlers with the AWS Chalice Python framework.
What do I get? / Deliverables
You get a Chalice-shaped repo with install steps, route decorators, and deployment-oriented layout ready to extend with business logic.
- Chalice app.py with routes
- requirements.txt and .chalice/config.json layout
- Optional chalicelib service modules
Recommended Skills
Journey fit
How it compares
Framework-specific Build guide, not a generic AWS CDK or Terraform deploy skill.
Common Questions / FAQ
Who is aws-lambda-python-integration for?
Solo builders and small teams using Python on AWS Lambda who want Chalice routing, config, and project conventions spelled out for coding agents.
When should I use aws-lambda-python-integration?
During Build when standing up a new Chalice API, adding HTTP methods to app.py, or aligning agent-generated code with standard chalicelib structure.
Is aws-lambda-python-integration safe to install?
It is instructional; review the Security Audits panel on this page and restrict deploy credentials and IAM policies your agent generates in your AWS account.
SKILL.md
READMESKILL.md - Aws Lambda Python Integration
# AWS Chalice Lambda Framework Complete guide for building AWS Lambda functions with the AWS Chalice framework. ## What is Chalice? AWS Chalice is a Python serverless microframework that lets you quickly create and deploy applications that use AWS Lambda. It provides: - Decorator-based routing (similar to Flask) - Automatic IAM policy generation - Local development server - Built-in CORS support - Easy deployment to API Gateway ## Installation ```bash # Install Chalice pip install chalice # Verify installation chalice --version # Create new project chalice new-project my-api cd my-api ``` ## Basic Structure ### Project Layout ``` my-chalice-project/ ├── app.py # Main application file ├── requirements.txt # Python dependencies ├── .chalice/ │ ├── config.json # Stage configuration │ └── deploy/ # Deployment artifacts (auto-generated) ├── chalicelib/ # Additional Python modules │ ├── __init__.py │ └── services.py └── tests/ └── test_app.py ``` ### Minimal Application ```python # app.py from chalice import Chalice app = Chalice(app_name='hello-world') @app.route('/') def index(): return {'hello': 'world'} ``` ## Routing ### HTTP Methods ```python from chalice import Chalice app = Chalice(app_name='my-api') @app.route('/users', methods=['GET']) def list_users(): return {'users': []} @app.route('/users', methods=['POST']) def create_user(): user = app.current_request.json_body return {'user': user, 'created': True} @app.route('/users/{user_id}', methods=['GET']) def get_user(user_id): return {'user_id': user_id} @app.route('/users/{user_id}', methods=['PUT']) def update_user(user_id): updates = app.current_request.json_body return {'user_id': user_id, 'updated': updates} @app.route('/users/{user_id}', methods=['DELETE']) def delete_user(user_id): return {'user_id': user_id, 'deleted': True} ``` ### Path Parameters ```python @app.route('/orders/{order_id}/items/{item_id}') def get_order_item(order_id, item_id): return { 'order_id': order_id, 'item_id': item_id } ``` ### Query Parameters ```python from urllib.parse import parse_qs @app.route('/search') def search(): # Access query parameters query_params = app.current_request.query_params or {} search_term = query_params.get('q') page = int(query_params.get('page', 1)) limit = int(query_params.get('limit', 10)) return { 'search_term': search_term, 'page': page, 'limit': limit } ``` ## Request Handling ### Accessing Request Data ```python @app.route('/data', methods=['POST']) def process_data(): request = app.current_request # Request properties return { 'method': request.method, # POST 'path': request.path, # /data 'query_params': request.query_params, 'headers': dict(request.headers), 'json_body': request.json_body, # Parsed JSON body 'raw_body': request.raw_body, # Raw bytes 'context': request.context, # Lambda context 'stage_vars': request.stage_vars, # API Gateway stage variables } ``` ### Custom Responses ```python from chalice import Response import json @app.route('/custom-response') def custom_response(): return Response( body=json.dumps({'message': 'Custom response'}), status_code=201, headers={ 'Content-Type': 'application/json', 'X-Custom-Header': 'value' } ) @app.route('/binary-data') def binary_data(): return Response( body=b'binary content', status_code=200, headers={'Content-Type': 'application/octet-stream'} ) ``` ## CORS Configuration ### Global CORS ```python from chalice import Chalice, CORSConfig # Global CORS configuration cors_config = CORSConfig( allow_origin='https://example.com', allow_headers=['Content-Type', 'Authorization'],