Description
Use case
Constructing response objects for use in Kinesis Firehose transformation functions.
This is a continuation of #1059 which describes the event object as well as the response object. The implementation for that issue can be found at #1540, but that does not include the response object.
Solution/User Experience
A data class that can be populated during the execution of a function that will be properly formed as a response to a KinesisFirehoseEvent
invocation.
Rough idea
KinesisFirehoseResponse:
records: list[KinssisFirehoseResponseRecord]
KinesisFirehoseResponseRecord:
record_id: str
result: Literal["Ok", "ProcessingFailed"]
data: bytes
metadata: KinesisFirehoseResponseRecordMetadata
KinesisFirehoseResponseRecordMetadata:
partition_keys: dict
Note: ☝🏼 I'm not sure if this is not an exhaustive list of options that can be returned
Alternative solutions
Previously, I've used basic dictionaries for this, but it would be nice to have a more structured data class to use.
The Go example in the Dynamic Partitioning in Kinesis Data Firehose has the concept of a KinesisFirehoseResponse
in their events package.
I believe it would be possible to re-use the KinesisFirehoseEvent
data class from the utilities.data_classes
module, but this seems like it is more geared for the event invocation object as opposed to the response object.
Acknowledgment
- This feature request meets Powertools for AWS Lambda (Python) Tenets
- Should this be considered in other Powertools for AWS Lambda languages? i.e. Java, TypeScript, and .NET
Metadata
Metadata
Assignees
Type
Projects
Status