question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature request: Add Event handler for AWS Lambda Function URLs

See original GitHub issue

Use case

With the general availability of AWS Lambda Function URLs to implement microservices AWS Lambda Powertools for Python should support handling this event type.

This should support the routes being specified in a separate file just like for other event handlers.

Solution/User Experience

from aws_lambda_powertools import Logger, Tracer
from aws_lambda_powertools.logging import correlation_paths
from aws_lambda_powertools.event_handler import FunctionUrl

tracer = Tracer()
logger = Logger()
app = FunctionUrl()

@app.get("/hello")
@tracer.capture_method
def get_hello_universe():
    return {"message": "hello universe"}

# You can continue to use other utilities just as before
@logger.inject_lambda_context(correlation_id_path=correlation_paths.FUNCTION_URL)
@tracer.capture_lambda_handler
def lambda_handler(event, context):
    return app.resolve(event, context)

Alternative solutions

No response

Acknowledgment

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:12 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
gwlestercommented, Apr 21, 2022

Ok, I will just wait for a status change on this or to hear back from ya’ll.

1reaction
gwlestercommented, Apr 21, 2022

@michaelbrewer – after looking at the code last night it looked like it would “just work”. It would still be nice to have an explicit class for it.

I know ya’ll did some work on this already – would you mind/like if I took a crack and submitted a Pull Request with it (assuming that I have time before August)?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Creating and managing Lambda function URLs
Configure a Lambda function URL to assign an HTTP(S) endpoint to your Lambda function without having to integrate with other AWS services.
Read more >
Lambda function URLs - AWS Documentation
A function URL is a dedicated HTTP(S) endpoint for your Lambda function. You can create and configure a function URL through the Lambda...
Read more >
Invoking Lambda function URLs - AWS Documentation
Invoke your Lambda function through a dedicated HTTP(S) endpoint using a web browser, curl, Postman, or any HTTP client.
Read more >
Receiving events using AWS Lambda function URLs
Your Amazon EventBridge event bus can use an AWS Lambda function URL created by an AWS CloudFormation template to receive events from supported...
Read more >
Tutorial: Creating a Lambda function with a function URL
Copy the following code example into a file named index. · Create a deployment package. · Add a resource-based policy to your function...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found