Skip to content

Instantly share code, notes, and snippets.

@tripleonard
Last active December 5, 2020 02:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tripleonard/eb718ba7b3214adba6e92548b895238a to your computer and use it in GitHub Desktop.
Save tripleonard/eb718ba7b3214adba6e92548b895238a to your computer and use it in GitHub Desktop.
"ActiveFlowConnectionAlarm": {
"Type": "AWS::CloudWatch::Alarm",
"Properties": {
"Metrics": [
{
"Expression": "m2/m1",
"Id": "e1",
"Label": "ActiveFlow/ActiveInstances",
"ReturnData": true
},
{
"Id": "m1",
"Label": "AsgInServiceInstances",
"MetricStat": {
"Metric": {
"Dimensions": [
{
"Name": "AutoScalingGroupName",
"Value": {
"Ref": "AsgResource"
}
}
],
"MetricName": "GroupInServiceInstances",
"Namespace": "AWS/AutoScaling"
},
"Period": 300,
"Stat": "Minimum"
},
"ReturnData": false
},
{
"Id": "m2",
"Label": "ActiveFlowCount_UDP",
"MetricStat": {
"Metric": {
"Dimensions": [
{
"Name": "LoadBalancer",
"Value": {
"Fn::GetAtt": [
"NlbResource",
"LoadBalancerFullName"
]
}
}
],
"MetricName": "ActiveFlowCount_UDP",
"Namespace": "AWS/NetworkELB"
},
"Period": 300,
"Stat": "Maximum"
},
"ReturnData": false
}
],
"EvaluationPeriods": 1,
"Threshold": {
"Ref": "ParameterThresholdValue"
},
"AlarmDescription": "Measures connection count",
"AlarmActions": [
{
"Ref": "ScaleUpPolicyResource"
}
],
"ComparisonOperator": "GreaterThanThreshold"
}
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment