【问题标题】:Cannot use unit in cloudwatch alarm via Terraform无法通过 Terraform 在 cloudwatch 警报中使用单位
【发布时间】:2019-03-16 07:30:15
【问题描述】:

我正在尝试使用 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。 我错过了什么吗?

【问题讨论】:

    标签: amazon-web-services terraform amazon-cloudwatch terraform-provider-aws amazon-cloudwatch-metrics


    【解决方案1】:

    AWS RDS 不支持NetworkReceiveThroughput 以兆字节/秒为单位,而仅支持Bytes/second。您可以在Cloudwatch user guide 中阅读有关可用选项的信息。

    也就是说,我有点惊讶 AWS API 不只是在您身上出错,而​​不是选择唯一可能的单位。

    【讨论】:

    • 但配置已更新,在警报的历史选项卡中显示 "unit": "Megabytes/Second"
    猜你喜欢
    • 2021-05-25
    • 2019-07-14
    • 2018-11-06
    • 2019-12-26
    • 2021-10-30
    • 2022-07-07
    • 2023-03-06
    • 2019-05-04
    • 2020-03-11
    相关资源
    最近更新 更多