The aws kinesis command is the official AWS Command Line Interface (CLI) tool specifically designed for interacting with Amazon Kinesis streaming data services. It provides a set of commands and options that allow you to manage and work with Kinesis data streams, Kinesis Data Firehose, and Kinesis Data Analytics.
Here are some key points about the aws kinesis command and its functionality:
- Kinesis Data Streams: Amazon Kinesis Data Streams is a service for ingesting, processing, and analyzing real-time streaming data. The aws kinesis command allows you to create, configure, and manage data streams. You can create and delete streams, adjust stream settings, and list information about existing streams.
- Kinesis Data Firehose: Amazon Kinesis Data Firehose simplifies the process of ingesting streaming data and delivering it to various destinations, such as Amazon S3, Amazon Redshift, or Amazon Elasticsearch. The aws kinesis command provides commands to create and manage data delivery streams for Kinesis Data Firehose. You can configure destinations, adjust delivery stream settings, and obtain information about existing delivery streams.
- Kinesis Data Analytics: Amazon Kinesis Data Analytics enables you to process and analyze streaming data using SQL queries. With the aws kinesis command, you can manage Kinesis Data Analytics applications. This includes creating and deleting applications, configuring input sources and output destinations, and retrieving application details.
- Record Processing: The aws kinesis command allows you to interact with individual records within a Kinesis data stream. You can put records into a stream, retrieve records, and delete records based on a specific sequence number or shard iterator.
- Enhanced Fan-out: Enhanced fan-out is a feature that enables real-time data consumption from Kinesis Data Streams by multiple consumers. The aws kinesis command includes commands to enable and disable enhanced fan-out on a stream, as well as manage consumer registration and de-registration.
The aws kinesis command is designed to simplify the management and operation of Amazon Kinesis streaming data services through the command line. It provides flexibility and automation capabilities for various Kinesis-related tasks, allowing you to build scalable and real-time streaming data architectures.
aws kinesis Command Examples
1. Show all streams in the account:
# aws kinesis list-streams
2. Write one record to a Kinesis stream:
# aws kinesis put-record --stream-name name --partition-key key --data base64_encoded_message
3. Write a record to a Kinesis stream with inline base64 encoding:
# aws kinesis put-record --stream-name name --partition-key key --data "$( echo "my raw message" | base64 )"
4. List the shards available on a stream:
# aws kinesis list-shards --stream-name name
5. Get a shard iterator for reading from the oldest message in a stream’s shard:
# aws kinesis get-shard-iterator --shard-iterator-type TRIM_HORIZON --stream-name name --shard-id id
6. Read records from a shard, using a shard iterator:
# aws kinesis get-records --shard-iterator iterator