You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The examples provided below are far from exhaustive - the data classes themselves are designed to provide a form of
@@ -456,9 +456,9 @@ In this example, we also use the new Logger `correlation_id` and built-in `corre
456
456
A simple echo script. Anything passed in \`\`\`echo\`\`\` parameter is returned as the content of custom widget.
457
457
458
458
### Widget parameters
459
-
Param | Description
460
-
---|---
461
-
**echo** | The content to echo back
459
+
| Param | Description |
460
+
| -------- | ------------------------ |
461
+
| **echo** | The content to echo back |
462
462
463
463
### Example parameters
464
464
\`\`\` yaml
@@ -497,6 +497,53 @@ decompress and parse json data from the event.
497
497
do_something_with(event.timestamp, event.message)
498
498
```
499
499
500
+
#### Kinesis integration
501
+
502
+
[When streaming CloudWatch Logs to a Kinesis Data Stream](https://aws.amazon.com/premiumsupport/knowledge-center/streaming-cloudwatch-logs/){target="_blank"} (cross-account or not), you can use `extract_cloudwatch_logs_from_event` to decode, decompress and extract logs as `CloudWatchLogsDecodedData` to ease log processing.
503
+
504
+
=== "app.py"
505
+
506
+
```python hl_lines="5-6 11"
507
+
from typing import List
508
+
509
+
from aws_lambda_powertools.utilities.data_classes import event_source
510
+
from aws_lambda_powertools.utilities.data_classes.cloud_watch_logs_event import CloudWatchLogsDecodedData
511
+
from aws_lambda_powertools.utilities.data_classes.kinesis_stream_event import (
Alternatively, you can use `extract_cloudwatch_logs_from_record` to seamless integrate with the [Batch utility](./batch.md) for more robust log processing.
525
+
526
+
=== "app.py"
527
+
528
+
```python hl_lines="3-4 10"
529
+
from aws_lambda_powertools.utilities.batch import (BatchProcessor, EventType,
530
+
batch_processor)
531
+
from aws_lambda_powertools.utilities.data_classes.kinesis_stream_event import (
Data classes and utility functions to help create continuous delivery pipelines tasks with AWS Lambda
@@ -553,18 +600,18 @@ Data classes and utility functions to help create continuous delivery pipelines
553
600
Cognito User Pools have several [different Lambda trigger sources](https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws-lambda-triggers.html#cognito-user-identity-pools-working-with-aws-lambda-trigger-sources), all of which map to a different data class, which
554
601
can be imported from `aws_lambda_powertools.data_classes.cognito_user_pool_event`:
0 commit comments