Skip to content

Instantly share code, notes, and snippets.

@landon9720
Created February 1, 2019 17:16
Show Gist options
  • Save landon9720/19419cf73635a6244b967b66cf515741 to your computer and use it in GitHub Desktop.
Save landon9720/19419cf73635a6244b967b66cf515741 to your computer and use it in GitHub Desktop.
CloudFront YAML configuration for CloudWatch alarms on Kinesis streams
AWSTemplateFormatVersion: "2010-09-09"
Description: Alarms for Kinesis streams
Parameters:
KinesisStreamName:
Description: name of stream to monitor
Type: String
Resources:
IteratorAgeMilliseconds:
Type: AWS::CloudWatch::Alarm
Properties:
AlarmName: !Sub "${KinesisStreamName} iterator age"
AlarmDescription: Kinesis consumer is too far behind
MetricName: GetRecords.IteratorAgeMilliseconds
Dimensions:
- Name: StreamName
Value: !Ref KinesisStreamName
Namespace: AWS/Kinesis
Statistic: Maximum
Period: 60
EvaluationPeriods: 1
ComparisonOperator: GreaterThanThreshold
Threshold: 1000
TreatMissingData: breaching
OKActions:
- !Ref "Topic"
AlarmActions:
- !Ref "Topic"
InsufficientDataActions:
- !Ref "Topic"
ActionsEnabled: true
ReadProvisionedThroughputExceeded:
Type: AWS::CloudWatch::Alarm
Properties:
AlarmName: !Sub "${KinesisStreamName} provisioned read throughput exceeded"
AlarmDescription: Kinesis stream is being read too much
MetricName: ReadProvisionedThroughputExceeded
Dimensions:
- Name: StreamName
Value: !Ref KinesisStreamName
Namespace: AWS/Kinesis
Statistic: Maximum
Period: 60
EvaluationPeriods: 1
ComparisonOperator: GreaterThanThreshold
Threshold: 0
TreatMissingData: notBreaching
OKActions:
- !Ref "Topic"
AlarmActions:
- !Ref "Topic"
InsufficientDataActions:
- !Ref "Topic"
ActionsEnabled: true
WriteProvisionedThroughputExceeded:
Type: AWS::CloudWatch::Alarm
Properties:
AlarmName: !Sub "${KinesisStreamName} provisioned write throughput exceeded"
AlarmDescription: Kinesis stream is being written too much
MetricName: WriteProvisionedThroughputExceeded
Dimensions:
- Name: StreamName
Value: !Ref KinesisStreamName
Namespace: AWS/Kinesis
Statistic: Maximum
Period: 60
EvaluationPeriods: 1
ComparisonOperator: GreaterThanThreshold
Threshold: 0
TreatMissingData: notBreaching
OKActions:
- !Ref "Topic"
AlarmActions:
- !Ref "Topic"
InsufficientDataActions:
- !Ref "Topic"
ActionsEnabled: true
Topic:
Type: "AWS::SNS::Topic"
Properties:
DisplayName: !Sub "${KinesisStreamName} stream alerts"
Subscription:
- Endpoint: "[email protected]"
Protocol: "email"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment