Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
2 tasks done
leandrodamascena opened this issue Jun 27, 2023 · 4 comments · Fixed by #2601
Closed
2 tasks done

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

leandrodamascena opened this issue Jun 27, 2023 · 4 comments · Fixed by #2601
Assignees
Labels

Comments

@leandrodamascena
Copy link
Contributor

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

@rubenfonseca
Copy link
Contributor

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

@rubenfonseca rubenfonseca self-assigned this Jun 27, 2023
@rubenfonseca rubenfonseca added event_handlers and removed triage Pending triage from maintainers labels Jun 27, 2023
@rubenfonseca rubenfonseca moved this from Triage to Pending review in Powertools for AWS Lambda (Python) Jun 27, 2023
@rubenfonseca rubenfonseca added the help wanted Could use a second pair of eyes/hands label Jun 27, 2023
@rubenfonseca rubenfonseca removed the help wanted Could use a second pair of eyes/hands label Jun 28, 2023
@rubenfonseca
Copy link
Contributor

Removed help wanted since there's a PR already

@rubenfonseca rubenfonseca linked a pull request Jun 28, 2023 that will close this issue
7 tasks
@github-project-automation github-project-automation bot moved this from Pending review to Coming soon in Powertools for AWS Lambda (Python) Jun 28, 2023
@github-actions
Copy link
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.

@github-actions github-actions bot added the pending-release Fix or implementation already in dev waiting to be released label Jun 28, 2023
@github-actions
Copy link
Contributor

This is now released under 2.19.0 version!

@github-actions github-actions bot removed the pending-release Fix or implementation already in dev waiting to be released label Jun 30, 2023
@rubenfonseca rubenfonseca moved this from Coming soon to Shipped in Powertools for AWS Lambda (Python) Jun 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Shipped
Development

Successfully merging a pull request may close this issue.

2 participants