1

我正在尝试使用 Terraform 创建 AWS cloudwatch 警报。

resource "aws_cloudwatch_metric_alarm" "rds_networkreceivethroughput" {
  alarm_name          = "rds_network_receive_throughput"
  comparison_operator = "GreaterThanOrEqualToThreshold"
  evaluation_periods  = "5"
  metric_name         = "NetworkReceiveThroughput"
  namespace           = "AWS/RDS"
  period              = "60"
  statistic           = "Average"
  threshold           = "10"
  unit                = "Megabytes/Second"
  alarm_description   = "The incoming (Receive) network traffic on the DB instanceis greater than threshold"
  treat_missing_data  = "notBreaching"

  alarm_actions = [
    "${aws_sns_topic.my_sns.arn}",
  ]

  dimensions {
    "DBInstanceIdentifier" = "${var.rds_instance_identifier}"
  }
}

我能够创建 cloudwatch 警报,但该单元没有得到应用。应用的单位是10 Bytes/Second而不是10 Megabytes/Second。我错过了什么吗?

在此处输入图像描述

4

1 回答 1

0

AWS RDS 不支持以兆字节/秒为单位NetworkReceiveThroughput,而仅支持Bytes/second. 您可以阅读Cloudwatch 用户指南中的可用选项。

也就是说,我有点惊讶 AWS API 不只是对您出错,而不是选择唯一可能的单元。

于 2018-10-11T10:27:52.223 回答