Closed
Description
Use case
With the general availability of Amazon VPC Lattice and considering that VPC Lattice supports Lambda as a target for VPC Target Group, then Powertools should add VPC Lattice as a new Event Handler to help customers easily manipulate routes, handle errors, custom response and so on.
This should have the same capabilities as other event handlers.
Solution/User Experience
import requests
from requests import Response
from aws_lambda_powertools.event_handler import VPCLatticeResolver
from aws_lambda_powertools.utilities.typing import LambdaContext
app = VPCLatticeResolver()
@app.get("/todo")
def get_todo():
todos: Response = requests.get("https://jsonplaceholder.typicode.com/todos")
todos.raise_for_status()
# for brevity, we'll limit to the first 10 only
return {"todos": todos.json()[:10]}
def lambda_handler(event: dict, context: LambdaContext) -> dict:
return app.resolve(event, context)
Alternative solutions
No response
Acknowledgment
- This feature request meets Powertools for AWS Lambda (Python) Tenets
- Should this be considered in other Powertools for AWS Lambda languages? i.e. Java, TypeScript, and .NET
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Shipped