Git Product home page Git Product logo

kinesis-scaling-workflow's Introduction

Kinesis Scaling Workflow

Simple Step Function to scale up/down your Kinesis Data Stream shard to the desired shard count.

Why?

Current Limitation of one single Kinesis Shard Update operation:

  • Cannot scale up to more than double your current shard count for a stream
  • Cannot scale down below half your current shard count for a stream

In order to scale up or scale down your shards beyond the double/half thresholds, you need to perform multiple update shard operations and wait in between. This package offers a simple step function to automate these steps.

Ref: Update Shard Count Doc

PS: I also wanted to try out the relatively new AWS SDK integrations from AWS Step Functions[Ref: Announcement]

CDK Deployment Steps

This packages uses AWS CDK to define and deploy infrastructure which includes a Lambda and a Step Function State Machine.

Pre-requisites: Install CDK and Configure AWS Credentials[Ref]

cd cdk
cdk synth
cdk deploy

Usage

After deployment, you can execute the State Machine via AWS console or via AWS CLI

State Machine Input Example:

{
  "stream_name": "test-stream",
  "desired_shard_count": 3
}

AWS CLI execution examole

aws stepfunctions start-execution \
--state-machine-arn arn:aws:states:us-east-1:123456789:stateMachine:KinesisScalingWorkflow \
--input "{\"stream_name\": \"test-stream\", \"desired_shard_count\": 1}"

Removal

cd cdk
cdk destroy

Manually remove any retained Lambda CloudWatch Log Groups

kinesis-scaling-workflow's People

Contributors

abhisheksp avatar

Stargazers

Lennard Timm avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.