Difference between revisions of "Aws cloudwatch metric alarm"
Jump to navigation
Jump to search
Line 3: | Line 3: | ||
* <code>[[aws cloudwatch metric]] [[alarm]]</code> | * <code>[[aws cloudwatch metric]] [[alarm]]</code> | ||
+ | |||
+ | == ChatGPT example (01/2023) == | ||
resource "aws_cloudwatch_metric_alarm" "elb_5xx_error_rate" { | resource "aws_cloudwatch_metric_alarm" "elb_5xx_error_rate" { | ||
alarm_name = "elb_5xx_error_rate" | alarm_name = "elb_5xx_error_rate" | ||
comparison_operator = "GreaterThanThreshold" | comparison_operator = "GreaterThanThreshold" | ||
evaluation_periods = "5" | evaluation_periods = "5" | ||
− | metric_name = "HTTPCode_Backend_5XX" | + | [[metric_name]] = "[[HTTPCode_Backend_5XX]]" |
namespace = "AWS/ApplicationELB" | namespace = "AWS/ApplicationELB" | ||
period = "60" | period = "60" |
Revision as of 09:43, 23 January 2023
ChatGPT example (01/2023)
resource "aws_cloudwatch_metric_alarm" "elb_5xx_error_rate" { alarm_name = "elb_5xx_error_rate" comparison_operator = "GreaterThanThreshold" evaluation_periods = "5" metric_name = "HTTPCode_Backend_5XX" namespace = "AWS/ApplicationELB" period = "60" statistic = "SampleCount" threshold = "1" alarm_description = "This alarm will notify when the 5XX error rate is greater than 1% for 5 consecutive minutes" alarm_actions = [aws_sns_topic.example.arn] dimensions = { LoadBalancer = aws_elbv2_load_balancer.example.name } }
resource "aws_sns_topic" "example" { name = "example-topic" }
See also
Advertising: