Reputation: 629
I am using aws_cli command to send events to kinesis data stream but having some issues while putting record into kinesis stream
commands
USER_ID="3456"
input_data={"user_id": $USER_ID,"name":"siva","qulification":"degree","age":"27","location":"canada"}
aws kinesis put-record --stream-name b-in-stream --partition-key 999 --data input_data
Note: USER_ID ==> its value is dynamic.
I used these commands on linux terminal but somehow aws-kinesis put-record
is not working.
Can anyone suggest a solution how to use kinesis put-record with a variable in the data field?
Upvotes: 0
Views: 640
Reputation: 239000
If you are using bash
in linux, your commands are incorrect. Your input data should be:
USER_ID="3456"
input_data='{"user_id": '$USER_ID',"name":"siva","qulification":"degree","age":"27","location":"canada"}'
Then, in the command you should use "${input_data}"
, not input_data
:
aws kinesis put-record --stream-name b-in-stream --partition-key 999 --data "${input_data}"
Upvotes: 2