Amazon Web Services (AWS) - Put data in Kinesis using the AWS CLI

by
Jeremy Canfield |
Updated: May 17 2024
| Amazon Web Services (AWS) articles
This assumes you have already configured the aws command line tool. If not, check out my article on Getting Started with the AWS CLI.
This also assumes you are familiar with Kinesis. If not, check out my article Getting Started with Kinesis.
The aws kinesis list-streams command can be used to list your Kinesis Data Stream. Let's say you have a Kinesis Data Stream named my-kinesis-data-stream.
~]$ aws kinesis list-streams
{
"StreamNames": [
"my-kinesis-data-stream"
],
"StreamSummaries": [
{
"StreamName": "my-kinesis-data-stream",
"StreamARN": "arn:aws:kinesis:us-east-1:123456789012:stream/my-kinesis-data-stream",
"StreamStatus": "ACTIVE",
"StreamModeDetails": {
"StreamMode": "ON_DEMAND"
},
"StreamCreationTimestamp": "2024-05-15T01:13:06+00:00"
}
]
}
Let's get the base64 of Hello World.
~]$ echo "Hello World" | base64
SGVsbG8gV29ybGQK
And then use the aws kinesis put-record command to put the record into our Kinesis Data Stream.
~]$ aws kinesis put-record --stream-name my-kinesis-data-stream --partition-key 123 --data SGVsbG8gV29ybGQK
{
"ShardId": "shardId-000000000000",
"SequenceNumber": "49652113470718930251584452799550684460532839240809054210"
}
Did you find this article helpful?
If so, consider buying me a coffee over at