简体   繁体   English

AWS CloudFormation-如何为警报(跨区域警报)指定CloudWatch指标的区域

[英]AWS CloudFormation - How to specify the region of a CloudWatch metric for an Alarm (Cross-region Alarms)

I'd like to find out how/where to specify the region of a CloudWatch metric in a CloudFormation template.我想找出如何/在CloudFormation模板中指定CloudWatch指标的区域。 I have attempted to specify the value in multiple locations.我试图在多个位置指定值。 Which has resulted in mostly malformed object or unsupported property errors.这导致了大多数格式错误的对象或不受支持的属性错误。 I have to assume its either not supported or there may be a workaround in the configuration.我必须假设其不受支持,或者配置中可能存在变通办法。 I have also tried to modify the alarm source tab (In the AWS UI) region property, which saves and displays the correct graph values.我还尝试修改警报源选项卡(在AWS UI中)区域属性,该属性可保存并显示正确的图形值。 Only later on it reverts on the final step of updating the alarm.仅在稍后,它将恢复更新警报的最后一步。 This same behavior can be observed while creating a new alarm as well.在创建新警报时也可以观察到相同的行为。 Essentially what I want is something like cross-region alarms.本质上,我想要的是跨区域警报之类的东西。

    MyAlarm:
        Type: "AWS::CloudWatch::Alarm"
        Properties:
            AlarmName: "MyAlarm"
            AlarmDescription: "a cool description"
            Dimensions:
              - Name: TaskListName
                Value: BatchWorkerTaskList
              - Name: Domain
                Value: SomeDomain
            Region: us-east-1 # <- tried this
            Metrics: 
                Region: us-east-1 # <- tried this
            MetricName: PendingTasks
            Namespace: AWS/SWF
            Period: 300
            ComparisonOperator: GreaterThanOrEqualToThreshold
            EvaluationPeriods: 1
            ExtendedStatistic: p50
            Threshold: 20
            Unit: Count
            AlarmActions:
            - !Ref "TriggerSomeScaling"
      

I'd like to find out how/where to specify the region of a CloudWatch metric in a CloudFormation template.我想找出如何/在CloudFormation模板中指定CloudWatch指标的区域。 I have attempted to specify the value in multiple locations.我试图在多个位置指定值。 Which has resulted in mostly malformed object or unsupported property errors.这导致了大多数格式错误的对象或不受支持的属性错误。 I have to assume its either not supported or there may be a workaround in the configuration.我必须假设其不受支持,或者配置中可能存在变通办法。 I have also tried to modify the alarm source tab (In the AWS UI) region property, which saves and displays the correct graph values.我还尝试修改警报源选项卡(在AWS UI中)区域属性,该属性可保存并显示正确的图形值。 Only later on it reverts on the final step of updating the alarm.仅在稍后,它将恢复更新警报的最后一步。 This same behavior can be observed while creating a new alarm as well.在创建新警报时也可以观察到相同的行为。 Essentially what I want is something like cross-region alarms.本质上,我想要的是跨区域警报之类的东西。

    MyAlarm:
        Type: "AWS::CloudWatch::Alarm"
        Properties:
            AlarmName: "MyAlarm"
            AlarmDescription: "a cool description"
            Dimensions:
              - Name: TaskListName
                Value: BatchWorkerTaskList
              - Name: Domain
                Value: SomeDomain
            Region: us-east-1 # <- tried this
            Metrics: 
                Region: us-east-1 # <- tried this
            MetricName: PendingTasks
            Namespace: AWS/SWF
            Period: 300
            ComparisonOperator: GreaterThanOrEqualToThreshold
            EvaluationPeriods: 1
            ExtendedStatistic: p50
            Threshold: 20
            Unit: Count
            AlarmActions:
            - !Ref "TriggerSomeScaling"
      

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM