Editing Terraform resource: aws cloudwatch metric alarm
Jump to navigation
Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
* https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_metric_alarm | * https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_metric_alarm | ||
aws_cloudwatch_metric_alarm | aws_cloudwatch_metric_alarm | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== Examples == | == Examples == | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
[[CPU]] | [[CPU]] | ||
resource "aws_cloudwatch_metric_alarm" "db_cpu_utilization_too_high" { | resource "aws_cloudwatch_metric_alarm" "db_cpu_utilization_too_high" { | ||
Line 59: | Line 21: | ||
} | } | ||
− | + | <pre> | |
− | + | resource "aws_cloudwatch_metric_alarm" "db_disk_queue_depth_too_high" { | |
− | |||
alarm_name = format("%s-%s", lower("${var.rds_name}"), "db-highDiskQueueDepth") | alarm_name = format("%s-%s", lower("${var.rds_name}"), "db-highDiskQueueDepth") | ||
comparison_operator = "GreaterThanThreshold" | comparison_operator = "GreaterThanThreshold" | ||
Line 71: | Line 32: | ||
threshold = "10" | threshold = "10" | ||
alarm_description = "Average database disk queue depth is too high, performance may be negatively impacted." | alarm_description = "Average database disk queue depth is too high, performance may be negatively impacted." | ||
− | + | ||
dimensions = { | dimensions = { | ||
DBInstanceIdentifier = aws_db_instance.rds_instance.id | DBInstanceIdentifier = aws_db_instance.rds_instance.id | ||
} | } | ||
− | + | } | |
− | + | resource "aws_cloudwatch_metric_alarm" "db_disk_free_storage_space_too_low" { | |
− | |||
− | |||
alarm_name = format("%s-%s", lower("${var.rds_name}"), "db-lowFreeStorageSpace") | alarm_name = format("%s-%s", lower("${var.rds_name}"), "db-lowFreeStorageSpace") | ||
comparison_operator = "[[LessThanThreshold]]" | comparison_operator = "[[LessThanThreshold]]" | ||
Line 93: | Line 52: | ||
DBInstanceIdentifier = aws_db_instance.rds_instance.id | DBInstanceIdentifier = aws_db_instance.rds_instance.id | ||
} | } | ||
− | + | } | |
− | + | resource "aws_cloudwatch_metric_alarm" "db_memory_freeable_too_low" { | |
− | |||
alarm_name = format("%s-%s", lower("${var.rds_name}"), "db-lowFreeableMemory") | alarm_name = format("%s-%s", lower("${var.rds_name}"), "db-lowFreeableMemory") | ||
comparison_operator = "LessThanThreshold" | comparison_operator = "LessThanThreshold" | ||
Line 110: | Line 68: | ||
DBInstanceIdentifier = aws_db_instance.rds_instance.id | DBInstanceIdentifier = aws_db_instance.rds_instance.id | ||
} | } | ||
− | + | } | |
+ | </pre> | ||
== ChatGPT examples for [[ALB]] (01/2023) == | == ChatGPT examples for [[ALB]] (01/2023) == | ||
Line 118: | Line 77: | ||
evaluation_periods = "5" | evaluation_periods = "5" | ||
[[metric_name]] = "[[HTTPCode_Backend_5XX]]" | [[metric_name]] = "[[HTTPCode_Backend_5XX]]" | ||
− | [[namespace]] = " | + | [[namespace]] = "AWS/ApplicationELB" |
period = "60" | period = "60" | ||
statistic = "SampleCount" | statistic = "SampleCount" | ||
Line 185: | Line 144: | ||
* <code>[[alarm_actions]]</code> | * <code>[[alarm_actions]]</code> | ||
* <code>[[aws_sns_topic]]</code> | * <code>[[aws_sns_topic]]</code> | ||
+ | * [[Comparison operator]] | ||
== See also == | == See also == |
Advertising: