Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

aws cli put-record for Kinesis

I am trying to write some data to AWS Kinesis with the CLI, but this isn't working:

aws kinesis put-record --stream-name my-stream-name --data Data=jose|12

I am getting a "bash: 12: command not found" error.

aws kinesis put-record help works so I don't understand the error.

I'm following this documentation.

like image 645
Powers Avatar asked Jan 29 '23 12:01

Powers


1 Answers

Just wrap your data with single quotes:

--data 'Data=jose|12'

otherwise bash will try to pipe the output of aws kinesis put-record --stream-name my-stream-name --data Data=jose to a program called 12, which does not exist.

You will also need to add the --partition-key argument, which you can randomly generate using --partition-key `uuidgen`. The whole command will be:

aws kinesis put-record --stream-name my-stream-name --data 'Data=jose|12' --partition-key `uuidgen`
like image 124
spg Avatar answered Feb 03 '23 22:02

spg