This CLI outputs newline separated records from kinesis. Written while developing another application as there did not seem to be a great way to simply dump records from all shards of a stream.
npm i -g kinesis-get-records-cli
To fetch the latest records:
kinesis-get-records --stream-name <StreamName> --shard-iterator-type <ShardIteratorType>
kinesis-get-records --region us-east-1 -s my-stream -i LATEST
If records are JSON objects, consider piping into jq
Put records using the AWS CLI:
aws --region <AWSRegion> kinesis put-records --records Data=\'{\"key\":\"blob-$(date --iso-8601=seconds)\"}\',PartitionKey=foo --stream-name <StreamName>
Output
{"key":"blob-2020-03-18T07:22:29-07:00"}
{"key":"blob-2020-03-18T07:22:31-07:00"}
npm run transpile
node lib --region <AWSRegion> -s <StreamName> -i LATEST