Skip to content

Feature request: Add Event handler for Amazon VPC Lattice #2577

Closed
@leandrodamascena

Description

@leandrodamascena

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

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Shipped

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions