Skip to content

Commit 68c8562

Browse files
docs(examples): standardize lambda handler function name (#2192)
1 parent b9b3933 commit 68c8562

39 files changed

+39
-39
lines changed

examples/logger/sam/template.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Description: AWS Lambda Powertools Tracer doc examples
55
Globals:
66
Function:
77
Timeout: 5
8-
Runtime: python3.9
8+
Runtime: python3.10
99
Tracing: Active
1010
Environment:
1111
Variables:

examples/logger/src/append_keys.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
logger = Logger()
55

66

7-
def handler(event: dict, context: LambdaContext) -> str:
7+
def lambda_handler(event: dict, context: LambdaContext) -> str:
88
order_id = event.get("order_id")
99

1010
# this will ensure order_id key always has the latest value before logging

examples/logger/src/append_keys_extra.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
logger = Logger()
55

66

7-
def handler(event: dict, context: LambdaContext) -> str:
7+
def lambda_handler(event: dict, context: LambdaContext) -> str:
88
fields = {"request_id": "1123"}
99
logger.info("Collecting payment", extra=fields)
1010

examples/logger/src/append_keys_kwargs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
logger = Logger()
55

66

7-
def handler(event: dict, context: LambdaContext) -> str:
7+
def lambda_handler(event: dict, context: LambdaContext) -> str:
88
logger.info("Collecting payment", request_id="1123")
99

1010
return "hello world"

examples/logger/src/append_keys_vs_extra.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class PaymentError(Exception):
1212
...
1313

1414

15-
def handler(event, context):
15+
def lambda_handler(event, context):
1616
logger.append_keys(payment_id="123456789")
1717
charge_id = event.get("charge_id", "")
1818

examples/logger/src/bring_your_own_formatter_from_scratch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@ def format(self, record: logging.LogRecord) -> str: # noqa: A003
3939

4040

4141
@logger.inject_lambda_context
42-
def handler(event, context):
42+
def lambda_handler(event, context):
4343
logger.info("Collecting payment")

examples/logger/src/clear_state.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66

77
@logger.inject_lambda_context(clear_state=True)
8-
def handler(event: dict, context: LambdaContext) -> str:
8+
def lambda_handler(event: dict, context: LambdaContext) -> str:
99
if event.get("special_key"):
1010
# Should only be available in the first request log
1111
# as the second request doesn't contain `special_key`

examples/logger/src/enabling_boto_logging.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
client = boto3.client("s3")
1313

1414

15-
def handler(event: Dict, context: LambdaContext) -> List:
15+
def lambda_handler(event: Dict, context: LambdaContext) -> List:
1616
response = client.list_buckets()
1717

1818
return response.get("Buckets", [])

examples/logger/src/fake_lambda_context_for_logger_module.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66

77
@logger.inject_lambda_context
8-
def handler(event: dict, context: LambdaContext) -> str:
8+
def lambda_handler(event: dict, context: LambdaContext) -> str:
99
logger.info("Collecting payment")
1010

1111
return "hello world"

examples/logger/src/inject_lambda_context.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66

77
@logger.inject_lambda_context
8-
def handler(event: dict, context: LambdaContext) -> str:
8+
def lambda_handler(event: dict, context: LambdaContext) -> str:
99
logger.info("Collecting payment")
1010

1111
# You can log entire objects too

0 commit comments

Comments
 (0)