This application is a proof of concept of how you can scale your Amazon Kinesis shards automatically using the Kinesis UpdateShardCount API from Lambda functions.
For these particular POC we used the Kinesis Metric Incoming Records and we set a cloudwatch alarm on this metric at a certain threshold.
When this threshold is breached the cloudwatch alarm is triggered and it sends an SNS message to the Lambda function which then executes the updateShardCount API by doubling the number of shards on the stream and then updating the metric alarm threshold to twice its original value.
When this threshold is breached the cloudwatch alarm is triggered and it sends an SNS message to the Lambda function which then executes the updateShardCount API by halfing the number of shards on the stream and then updating the metric alarm threshold to half its original value.
- AWS Account
- Amazon Kinesis Stream
- LambdaExecutionRole AWS::IAM::Role
- SNSSubscription AWS::SNS::Subscription
- SNSTopic AWS::SNS::Topic
- ScaleDownAlarm AWS::CloudWatch::Alarm
- ScaleDownKinesisShards AWS::Lambda::Function
- ScaleUpAlarm AWS::CloudWatch::Alarm
- ScaleUpKinesisShards AWS::Lambda::Function
