Created
June 1, 2021 10:15
-
-
Save markymarkus/5cbdd164448a0a03de1c8ab892b8a997 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# usage json_to_firehose.py input_file.json my_firehose_stream | |
import json | |
import sys | |
import boto3 | |
client = boto3.client('firehose') | |
filename = sys.argv[1] | |
streamname = sys.argv[2] | |
with open(filename) as f: | |
d = json.load(f) | |
event_str = json.dumps(d) | |
resp = client.put_record(DeliveryStreamName=streamname, | |
Record={ | |
'Data': event_str | |
} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment