Terraform module for creating AWS ALB Error rate based CloudWatch Alarm.
Copy and paste into your Terraform configuration, insert the variables, and run terraform init:
module "alb-error-rate-based-alarm" {
source = "topotal/alb-error-rate-based-alarm/aws"
version = "0.2.1"
sns_topic_arn = "YOUR_SNS_TOPIC_ARN_FOR_NOTIFICATION"
dimensions = {
LoadBalancer = "app/YOUR_LOAD_BALANCER_NAME/YOUR_LOAD_BALANCER_ID"
}
}
or you can speficy TargetGroup
to dimensions if you want to monitor only for TargetGroup:
module "alb-error-rate-based-alarm" {
source = "topotal/alb-error-rate-based-alarm/aws"
version = "0.2.1"
sns_topic_arn = "YOUR_SNS_TOPIC_ARN_FOR_NOTIFICATION"
dimensions = {
LoadBalancer = "app/YOUR_LOAD_BALANCER_NAME/YOUR_LOAD_BALANCER_ID"
TargetGroup = "targetgroup/YOUR_TARGET_GROUP_NAME/YOUR_TARGET_GROUP_ID"
}
}
The default threshold is 99.9% SLO and 14.4 Burn Rate with 1 hour time window (SLO budget consumption 2%).
This module can also specify slo, burn_rate and window like below:
module "alb-error-rate-based-alarm" {
source = "topotal/alb-error-rate-based-alarm/aws"
version = "0.2.1"
sns_topic_arn = "YOUR_SNS_TOPIC_ARN_FOR_NOTIFICATION"
dimensions = {
LoadBalancer = "app/YOUR_LOAD_BALANCER_NAME/YOUR_LOAD_BALANCER_ID"
}
slo = 99.99
burn_rate = 6
period = 60 * 60 * 6
}
Name | Version |
---|---|
terraform | >= 1.0.0 |
aws | >= 3.74.0 |
Name | Version |
---|---|
aws | >= 3.74.0 |
No modules.
Name | Type |
---|---|
aws_cloudwatch_metric_alarm.alarm | resource |
Name | Description | Type | Default | Required |
---|---|---|---|---|
alarm_description | The description of the alarm | string |
"This alarm monitors ALB/TargetGroup error rate with burn rate" |
no |
alarm_name | The name of the alarm | string |
"alb-error-rate-alarm" |
no |
burn_rate | The burn rate to use for the alarm | number |
14.4 |
no |
comparison_operator | The comparison operator to use for the alarm | string |
"GreaterThanOrEqualToThreshold" |
no |
dimensions | The dimensions to use for the metrics | map(string) |
n/a | yes |
evaluation_periods | The number of periods over which data is compared to the specified threshold | string |
"1" |
no |
insufficient_data_actions | The list of actions to take when the alarm is in insufficient data state | list(string) |
[] |
no |
slo | The SLO to use for the alarm | number |
99.9 |
no |
sns_topic_arn | The arn of the SNS topic to use for alarm notifications | string |
n/a | yes |
window | The window to use for the metrics | number |
3600 |
no |
Name | Description |
---|---|
cloudwatch_alarm | The created CloudWatch alarm |