AWS Firehose was released today. I'm playing around with it and trying to figure out how to put data into the stream using AWS CLI. I have a simple JSON payload and the corresponding Redshift table with columns that map to the JSON attributes. I've tried various combinations but I can't seem to pass in the JSON payload via the cli.
What I've tried:
aws firehose put-record --delivery-stream-name test-delivery-stream --record '{ "attribute": 1 }'
aws firehose put-record --delivery-stream-name test-delivery-stream --record { "attribute": 1 }
aws firehose put-record --delivery-stream-name test-delivery-stream --record Data='{ "attribute": 1 }'
aws firehose put-record --delivery-stream-name test-delivery-stream --record Data={ "attribute": 1 }
aws firehose put-record --delivery-stream-name test-delivery-stream --cli-input-json '{ "attribute": 1 }'
aws firehose put-record --delivery-stream-name test-delivery-stream --cli-input-json { "attribute": 1 }
I've looked at the cli help which hasn't helped. This article was published today but looks like the command they use is already outdated as the argument "--firehose-name" has been replaced by "--delivery-stream-name".
Escape the double-quotes around keys and values inside the blob:
aws firehose put-record --delivery-stream-name test-delivery-stream --record '{"Data":"{\"attribute\":1}"}'
I have issues with my credentials and region, but this syntax at least got me past parsing errors:
aws firehose put-record --cli-input-json '{"DeliveryStreamName":"testdata","Record":{"Data":"test data"}}'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With