← 返回命令列表

Linux command

aws-dynamodbstreams 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

List all streams

aws dynamodbstreams list-streams --table-name [table_name]

Describe a stream

aws dynamodbstreams describe-stream --stream-arn [arn:aws:dynamodb:region:account:table/name/stream/timestamp]

Get a shard iterator

aws dynamodbstreams get-shard-iterator --stream-arn [stream_arn] --shard-id [shard_id] --shard-iterator-type [TRIM_HORIZON|LATEST|AT_SEQUENCE_NUMBER]

Read records

aws dynamodbstreams get-records --shard-iterator [iterator_string]

Get shard iterator at a specific sequence number

aws dynamodbstreams get-shard-iterator --stream-arn [stream_arn] --shard-id [shard_id] --shard-iterator-type AT_SEQUENCE_NUMBER --sequence-number [seq_num]

说明

aws dynamodbstreams is a subcommand of the AWS CLI that reads change data capture records from DynamoDB Streams. When streams are enabled on a DynamoDB table, every modification (insert, update, delete) is captured as a stream record. Streams organize records into shards, which are containers for sequenced records. To read stream data, you first obtain a shard iterator and then use it to retrieve records. Each shard iterator expires after 15 minutes of inactivity. Stream records can include the old item image, new item image, or both, depending on the stream view type configured on the table. This enables use cases like replication, analytics, and triggering downstream workflows.

参数

list-streams
List stream ARNs for a table or all tables.
describe-stream
Get stream metadata including shard information.
get-shard-iterator
Get an iterator for reading records from a shard.
get-records
Read stream records using a shard iterator.
--stream-arn _arn_
The Amazon Resource Name of the stream.
--table-name _name_
Filter streams by table name.
--shard-id _id_
The identifier of the shard to read.
--shard-iterator _string_
Iterator returned by get-shard-iterator.
--shard-iterator-type _type_
Where to start reading: TRIM_HORIZON (oldest), LATEST (newest), AT_SEQUENCE_NUMBER, or AFTER_SEQUENCE_NUMBER.
--sequence-number _number_
Start at this sequence number (requires AT/AFTER_SEQUENCE_NUMBER type).
--limit _number_
Maximum number of records to return.

FAQ

What is the aws-dynamodbstreams command used for?

aws dynamodbstreams is a subcommand of the AWS CLI that reads change data capture records from DynamoDB Streams. When streams are enabled on a DynamoDB table, every modification (insert, update, delete) is captured as a stream record. Streams organize records into shards, which are containers for sequenced records. To read stream data, you first obtain a shard iterator and then use it to retrieve records. Each shard iterator expires after 15 minutes of inactivity. Stream records can include the old item image, new item image, or both, depending on the stream view type configured on the table. This enables use cases like replication, analytics, and triggering downstream workflows.

How do I run a basic aws-dynamodbstreams example?

Run `aws dynamodbstreams list-streams --table-name [table_name]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does list-streams do in aws-dynamodbstreams?

List stream ARNs for a table or all tables.