Skip to content

Commit febe483

Browse files
committed
chore(docs): updated links
1 parent 1039c04 commit febe483

File tree

2 files changed

+39
-5
lines changed

2 files changed

+39
-5
lines changed

aws_lambda_powertools/event_handler/lambda_function_url.py

+35
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,41 @@
66

77

88
class LambdaFunctionUrlResolver(ApiGatewayResolver):
9+
"""AWS Lambda Function URL resolver
10+
11+
Notes:
12+
-----
13+
For now, this seems to work the same way as API Gateway HTTP APIs Payload Format Version 2.0.
14+
15+
Documentation:
16+
- https://docs.aws.amazon.com/lambda/latest/dg/urls-configuration.html
17+
- https://docs.aws.amazon.com/lambda/latest/dg/urls-invocation.html#urls-payloads
18+
19+
Examples
20+
--------
21+
Simple example with a custom lambda handler using the Tracer capture_lambda_handler decorator
22+
23+
```python
24+
from aws_lambda_powertools import Tracer
25+
from aws_lambda_powertools.event_handler import LambdaFunctoinUrlResolver
26+
27+
tracer = Tracer()
28+
app = LambdaFunctoinUrlResolver()
29+
30+
@app.get("/get-call")
31+
def simple_get():
32+
return {"message": "Foo"}
33+
34+
@app.post("/post-call")
35+
def simple_post():
36+
post_data: dict = app.current_event.json_body
37+
return {"message": post_data["value"]}
38+
39+
@tracer.capture_lambda_handler
40+
def lambda_handler(event, context):
41+
return app.resolve(event, context)
42+
"""
43+
944
current_event: LambdaFunctionUrlEvent
1045

1146
def __init__(

aws_lambda_powertools/utilities/data_classes/lambda_function_url_event.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@ class LambdaFunctionUrlEvent(APIGatewayProxyEventV2):
66
77
Notes:
88
-----
9-
For now, this seems to follow the exact payload as HTTP APIs Payload Format Version 2.0.
10-
Certain keys in this payload format don't make sense for function urls (e.g: `routeKey`).
11-
These keys will always be null.
9+
For now, this seems to follow the exact same payload as HTTP APIs Payload Format Version 2.0.
10+
Certain keys in this payload format don't make sense for function urls (e.g: `routeKey`, `stage`).
11+
These keys will have default values that come on the payload, but they are not useful since they can't be changed.
1212
1313
Documentation:
14+
- https://docs.aws.amazon.com/lambda/latest/dg/urls-configuration.html
1415
- https://docs.aws.amazon.com/lambda/latest/dg/urls-invocation.html#urls-payloads
15-
- https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
16-
1716
"""
1817

1918
pass

0 commit comments

Comments
 (0)