Ansible ec2_metric_alarm 区域问题

Ansible ec2_metric_alarm region issue

- 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 应用云警报,但出现错误。其中说:

fatal: [127.0.0.1]: FAILED! => {"changed": false, "failed": true, "msg": "BotoServerError: 400 Bad Request\nhttp://monitoring.amazonaws.com/doc/2010-08-01/\">\n \n Sender\n ValidationError\n Invalid region us-east-1 specified. Only us-west-2 is supported.\n \n fca09709-ad15-11e6-89f8-c1737af27609\n\n"}

当我对 us-east-1 进行同样的尝试时,它起作用了,但不适用于 us-east-1 以外的任何其他区域。我对 us-east-2、us-west-1、us-west-2 进行了同样的尝试,但没有成功。关于如何解决这个问题有什么建议吗?

澄清helloV评论中的答案

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