Skip to content

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

Closed

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

Activity

  1. added
    triage
    feature-request
    on Jun 27, 2023
  2. rubenfonseca commented on Jun 27, 2023

    @rubenfonseca
    Contributor

    Super interesting @leandrodamascena, this seems bigger than the event parser though. But let me know if you want to work on it :)

  3. self-assigned this
    on Jun 27, 2023
  4. added and removed
    triage
    on Jun 27, 2023
  5. moved this from Triage to Pending review in Powertools for AWS Lambda (Python)on Jun 27, 2023
  6. added
    help wanted
    and removed
    help wanted
    on Jun 27, 2023
  7. rubenfonseca commented on Jun 28, 2023

    @rubenfonseca
    Contributor

    Removed help wanted since there's a PR already

  8. github-actions commented on Jun 28, 2023

    @github-actions
    Contributor

    ⚠️COMMENT VISIBILITY WARNING⚠️

    This issue is now closed. Please be mindful that future comments are hard for our team to see.

    If you need more assistance, please either tag a team member or open a new issue that references this one.

    If you wish to keep having a conversation with other community members under this issue feel free to do so.

  9. added
    pending-release
    on Jun 28, 2023
  10. github-actions commented on Jun 30, 2023

    @github-actions
    Contributor

    This is now released under 2.19.0 version!

  11. removed
    pending-release
    on Jun 30, 2023
  12. moved this from Coming soon to Shipped in Powertools for AWS Lambda (Python)on Jun 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions