File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed
integration-kinesis-to-lambda Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change 1
1
import base64
2
- import json
3
- import boto3
4
2
def lambda_handler (event , context ):
5
- kinesis = boto3 . client ( 'kinesis' )
3
+
6
4
for record in event ['Records' ]:
7
5
try :
8
6
print (f"Processed Kinesis Event - EventID: { record ['eventID' ]} " )
9
- record_data = get_record_data (record ['kinesis' ])
7
+ record_data = base64 . b64decode (record ['kinesis' ][ 'data' ]). decode ( 'utf-8' )
10
8
print (f"Record Data: { record_data } " )
11
9
# TODO: Do interesting work based on the new data
12
10
except Exception as e :
13
11
print (f"An error occurred { e } " )
14
12
raise e
15
13
print (f"Successfully processed { len (event ['Records' ])} records." )
16
- def get_record_data (payload ):
17
- data = base64 .b64decode (payload ['data' ]).decode ('utf-8' )
18
- # Placeholder for actual async work, you can use asyncio or threading for that
19
- return data
You can’t perform that action at this time.
0 commit comments