Wednesday, July 27, 2022

[SOLVED] How to feed json from file to aws kinesis put-record

Issue

How to supply content of the file containing json to aws kinesis put-record?

I'd tried aws kinesis put-record --stream-name test_event --partition-key 1 --cli-input-json < file.jsonbut got argument --cli-input-json: expected one argument


Solution

Answer

Use

--cli-input-json file://file.json

instead of

--cli-input-json < file.json

Update - Sharing valid sample json for the command aws kinesis put-record

{
    "StreamName": "",
    "Data": null,
    "PartitionKey": "",
    "ExplicitHashKey": "",
    "SequenceNumberForOrdering": ""
}

The same can be obtained via aws kinesis put-record --generate-cli-skeleton



Answered By - iArc13
Answer Checked By - Terry (WPSolving Volunteer)