AWS Kinesis Common Operations using the AWS CLI: Reference & Examples

AWS Kinesis Common Operations using the AWS CLI: Reference & Examples

Last updated:

WIP Alert This is a work in progress. Current information is correct but more content will probably be added in the future.

HEADS-UP If you have not yet installed the aws cli, you need to install it and set up you credentials

Create a stream

$ aws create-stream \
  --stream-name "my-stream" \
  --shard-count 1

Reshard a stream

I.e. add more shards to a stream.

Note that you can only set the new number of shards up to the limit of double your current number of shards.

E.g. (suppose my-stream currently has one single shard and we want to increase it to 2):

$ aws kinesis update-shard-count \
   --stream-name "my-stream" \
   --target-shard-count 2 \
   --scaling-type "UNIFORM_SCALING"

Enable enhanced monitoring

I.e. unlock shard-level (not just stream-level) cloudwatch metrics.

$ aws kinesis \
   --stream-name "my-stream" \
   --shard-level-metrics "ALL"

LimitExceededException

This can happen for a variety of reasons, such as:

  • Trying to update the number of shards (resharding) more than twice in a single day

  • Trying to create more than 5 shards in a short period of time

Overall, if you see this exception upon trying to do something, chances are it'll go away by itself if you try again some other time (wait a couple of hours or maybe a day or two).


See also