Skip to content

Commit c039480

Browse files
committed
docs: give info upfront, name examples
1 parent eb39c03 commit c039480

File tree

2 files changed

+12
-44
lines changed

2 files changed

+12
-44
lines changed

docs/utilities/data_classes.md

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -975,36 +975,31 @@ or plain text, depending on the original payload.
975975

976976
### Kinesis Firehose delivery stream
977977

978-
Kinesis Firehose Data Transformation can use a Lambda Function to modify the records
979-
inline, and re-emit them back to the Delivery Stream.
978+
When using Kinesis Firehose, you can use a Lambda function to [perform data transformation](https://docs.aws.amazon.com/firehose/latest/dev/data-transformation.html){target="_blank"}. For each transformed record, you can choose to either:
980979

981-
Similar to Kinesis Data Streams, the events contain base64 encoded data. You can use the helper
982-
function to access the data either as json or plain text, depending on the original payload.
980+
* **A)** Put them back to the delivery stream (default)
981+
* **B)** Drop them so consumers don't receive them (e.g., data validation)
982+
* **C)** Indicate a record failed data transformation and should be retried
983983

984-
When constructing response to Firehose, You can utilize the `KinesisFirehoseDataTransformationResponse` class shown
985-
in the example below.
984+
To do that, you can use `KinesisFirehoseDataTransformationResponse` class along with helper functions to make it easier to decode and encode base64 data in the stream.
986985

987-
=== "app.py"
986+
=== "Transforming streaming records"
988987

989988
```python
990989
--8<-- "examples/event_sources/src/kinesis_firehose_delivery_stream.py"
991990
```
992991

993-
You can also construct response without using `event_source` wrapper. Shown in the example below.
994-
995-
=== "app.py"
992+
=== "Dropping invalid records"
996993

997994
```python
998-
--8<-- "examples/event_sources/src/kinesis_firehose_response.py"
995+
--8<-- "examples/event_sources/src/kinesis_firehose_response_drop.py"
999996
```
1000-
=== "with Failure"
1001-
```python hl_lines="30"
997+
998+
=== "Indicating a processing failure"
999+
1000+
```python
10021001
--8<-- "examples/event_sources/src/kinesis_firehose_response_exception.py"
10031002
```
1004-
=== "with Dropped"
1005-
```python hl_lines="30"
1006-
--8<-- "examples/event_sources/src/kinesis_firehose_response_drop.py"
1007-
```
10081003

10091004
### Lambda Function URL
10101005

examples/event_sources/src/kinesis_firehose_response.py

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)