简体   繁体   English

如何在 Cloudformation 中为 DocumentDB 创建 CloudWatch 警报

[英]How do I create CloudWatch Alarms for DocumentDB in Cloudformation

How do I create Cloudwatch alarms in Cloudformation for AWS DocumentDB.如何在 Cloudformation 中为 AWS DocumentDB 创建 Cloudwatch 警报。 There are no examples available.没有可用的示例。 How to add CPU Utilization alarm on Primary vs Reader instances?如何在 Primary 实例和 Reader 实例上添加 CPU 使用率警报?

I have tried creating an alarm, but faced issues with differentiating between the Primary vs Reader instance.我曾尝试创建警报,但在区分主实例和读取器实例时遇到了问题。

Can anyone please share a sample yaml/json cloudformation - to build such an alarm.任何人都可以分享一个示例 yaml/json cloudformation - 来构建这样的警报。

To create an alarm for CPU utilization on DocumentDB primary and reader instances using AWS CloudFormation, you could use the following script:要使用 AWS CloudFormation 在 DocumentDB 主实例和读取器实例上创建 CPU 使用率警报,您可以使用以下脚本:

Resources:
  DocumentDBPrimaryCPUAlarm:
    Type: AWS::CloudWatch::Alarm
    Properties:
      AlarmDescription: CPU utilization is high on the DocumentDB primary instance
      ComparisonOperator: GreaterThanThreshold
      EvaluationPeriods: 1
      MetricName: CPUUtilization
      Namespace: AWS/RDS
      Period: 60
      Statistic: Average
      Threshold: 90
      ActionsEnabled: true
      AlarmActions:
        - arn:aws:sns:<region>:<account-id>:<sns-topic-name>
      Dimensions:
        - Name: DBInstanceIdentifier
          Value: <documentdb-primary-instance-id>

  DocumentDBReaderCPUAlarm:
    Type: AWS::CloudWatch::Alarm
    Properties:
      AlarmDescription: CPU utilization is high on the DocumentDB reader instance
      ComparisonOperator: GreaterThanThreshold
      EvaluationPeriods: 1
      MetricName: CPUUtilization
      Namespace: AWS/RDS
      Period: 60
      Statistic: Average
      Threshold: 90
      ActionsEnabled: true
      AlarmActions:
        - arn:aws:sns:<region>:<account-id>:<sns-topic-name>
      Dimensions:
        - Name: DBInstanceIdentifier
          Value: <documentdb-reader-instance-id>

The above YAML creates two alarms: one for the primary DocumentDB instance and one for the reader instance.上面的 YAML 创建了两个警报:一个针对主 DocumentDB 实例,一个针对读取器实例。 The alarms monitor the CPU utilization and will trigger an SNS notification if the utilization goes above 90%.警报监视 CPU 利用率,如果利用率超过 90%,将触发 SNS 通知。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何让 CodeDeploy Blue/Green 为自定义指标创建 CloudWatch 警报? - How to make CodeDeploy Blue/Green create CloudWatch alarms for custom metrics? 如何使用 CloudFormation 为 CloudWatch Logs 定义资源策略? - How to define Resource Policy for CloudWatch Logs with CloudFormation? Cloudformation 应该在不同的可用性区域中创建 documentdb 副本 - Cloudformation should create documentdb replicas in different availability zones 如何在 cloudwatch 中记录多维指标? - How do I record multidimensional metrics in cloudwatch? 如何在现有 su.net 或我创建的 su.net 模板中指定 su.netID? - How do I specify subnetID in cloudformation template, either from existing subnet or one that I create? terraform 资源应该根据变量创建多个CloudWatch告警,计划中确认了但只部署了一个告警 - terraform resource should create multiple CloudWatch alarms based on variable, which is confirmed in the plan but only deploys one alarm Cloudformation Cloudwatch 输入模板格式化 - Cloudformation Cloudwatch InputTemplate Formatting 我们如何使用 AWS CloudFormation 创建 SageMaker 管道? - How do we create a SageMaker pipeline using AWS CloudFormation? 我如何使用 cloudformation 创建和更新 WAF IPset - how can i create and update WAF IPset using cloudformation 如何使用 CloudFormation 成功检索 ALB ListenerArn 以设置 ListenerRules? - How do I successfully retrieve an ALB ListenerArn with CloudFormation to setup ListenerRules?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM