Ansible ec2_metric_alarm区域问题

时间:2016-11-17 22:46:08

标签: amazon-web-services amazon-ec2 ansible amazon-cloudwatch

- name: Create Alarm
  ec2_metric_alarm:
    state: present
    region: us-west-2
    name: "Low_On_CPU"
    metric: "CPUUtilization"
    namespace: "AWS/EC2"
    statistic: Average
    comparison: ">="
    threshold: 75.0
    period: 300
    evaluation_periods: 1
    unit: "Percent"
    description: "The alarm will send notification message when CPU is over 75 percent"
    alarm_actions: "{{ alarm_action }}"
    ok_actions: "{{ ok_action }}"

对于地区:我想为us-west-2应用云警报,但是我收到了错误。其中说:

  

致命:[127.0.0.1]:失败! => {“已更改”:false,“failed”:true,“msg”:“BotoServerError:400 Bad Request \ nhttp://monitoring.amazonaws.com/doc/2010-08-01/ \”> \ n \ n发件人\ n ValidationError \ n指定了无效的区域us-east-1。仅支持us-west-2。\ n \ n fca09709-ad15-11e6-89f8-c1737af27609 \ n \ n“}

当我尝试使用us-east-1时,它起作用,但除了us-east-1之外,它不适用于任何其他区域。我和我们一样尝试了东 - 2,我们 - 西1,我们 - 西2但没有运气。关于如何解决这个问题的任何建议?

1 个答案:

答案 0 :(得分:0)

澄清helloV的评论中的答案。

问题是alarm_actions的SNS主题与创建警报的区域不同。