{"action":"opened","issue":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/4540","repository_url":"https://api.github.com/repos/ansible/ansible-modules-core","labels_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/4540/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/4540/comments","events_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/4540/events","html_url":"https://github.com/ansible/ansible-modules-core/issues/4540","id":173274791,"number":4540,"title":"ec2_metric_alarm period not in seconds and causes issues with aws api","user":{"login":"sarlindo","id":6406166,"avatar_url":"https://avatars.githubusercontent.com/u/6406166?v=3","gravatar_id":"","url":"https://api.github.com/users/sarlindo","html_url":"https://github.com/sarlindo","followers_url":"https://api.github.com/users/sarlindo/followers","following_url":"https://api.github.com/users/sarlindo/following{/other_user}","gists_url":"https://api.github.com/users/sarlindo/gists{/gist_id}","starred_url":"https://api.github.com/users/sarlindo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sarlindo/subscriptions","organizations_url":"https://api.github.com/users/sarlindo/orgs","repos_url":"https://api.github.com/users/sarlindo/repos","events_url":"https://api.github.com/users/sarlindo/events{/privacy}","received_events_url":"https://api.github.com/users/sarlindo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-25T18:20:48Z","updated_at":"2016-08-25T18:20:48Z","closed_at":null,"body":"<!--- Verify first that your issue/request is not already reported in GitHub -->\r\n\r\n##### ISSUE TYPE\r\n - Bug Report\r\n\r\n##### COMPONENT NAME\r\nec2_metric_alarm\r\n\r\n##### ANSIBLE VERSION\r\n```\r\nansible 2.1.0.0\r\n  config file = /home/vagrant/projects/icp/ansible.cfg\r\n  configured module search path = Default w/o overrides\r\n\r\n```\r\n\r\n##### CONFIGURATION\r\n<!---\r\nMention any settings you have changed/added/removed in ansible.cfg\r\n(or using the ANSIBLE_* environment variables).\r\n-->\r\n\r\n##### OS / ENVIRONMENT\r\n\r\nFedora release 22\r\n\r\n##### SUMMARY\r\n\r\nThe period parameter is document as a \"seconds\" field, but it seems to be in minutes and the aws boto api expects this in seconds and 60 seconds is the min value. This causes issues if I try to set this to 5min because boto complains.\r\n\r\nfailed: [172.26.4.168 -> localhost] (item=tadlxapp-ngxdb01) => {\"failed\": true, \"item\": \"tadlxapp-ngxdb01\", \"msg\": \"BotoServerError: 400 Bad Request\\n<ErrorResponse xmlns=\\\"http://monitoring.amazonaws.com/doc/2010-08-01/\\\">\\n  <Error>\\n    <Type>Sender</Type>\\n    <Code>ValidationError</Code>\\n    <Message>1 validation error detected: Value '30' at 'period' failed to satisfy constraint: Member must have value greater than or equal to 60</Message>\\n  </Error>\\n  <RequestId>fcc7c56c-6aee-11e6-8606-0fffc56c6105</RequestId>\\n</ErrorResponse>\\n\"}\r\n\r\n\r\n##### STEPS TO REPRODUCE\r\n\r\n```\r\nThis was taken from the example in the documentation, this won't work either because 300 won't be accepted.\r\n\r\n- name: create alarm\r\n  ec2_metric_alarm:\r\n    state: present\r\n    region: ap-southeast-2\r\n    name: \"cpu-low\"\r\n    metric: \"CPUUtilization\"\r\n    namespace: \"AWS/EC2\"\r\n    statistic: Average\r\n    comparison: \"<=\"\r\n    threshold: 5.0\r\n    period: 300\r\n    evaluation_periods: 3\r\n    unit: \"Percent\"\r\n    description: \"This will alarm when a bamboo slave's cpu usage average is lower than 5% for 15 minutes \"\r\n    dimensions: {'InstanceId':'i-XXX'}\r\n    alarm_actions: [\"action1\",\"action2\"]\r\n```\r\n\r\n##### EXPECTED RESULTS\r\n\r\nI expect to be able to set the period to 5min.\r\n\r\n##### ACTUAL RESULTS\r\n\r\n```\r\n\r\nfailed: [172.26.4.168 -> localhost] (item=tadlxapp-ngxdb01) => {\"failed\": true, \"item\": \"tadlxapp-ngxdb01\", \"msg\": \"BotoServerError: 400 Bad Request\\n<ErrorResponse xmlns=\\\"http://monitoring.amazonaws.com/doc/2010-08-01/\\\">\\n  <Error>\\n    <Type>Sender</Type>\\n    <Code>ValidationError</Code>\\n    <Message>1 validation error detected: Value '30' at 'period' failed to satisfy constraint: Member must have value greater than or equal to 60</Message>\\n  </Error>\\n  <RequestId>fcc7c56c-6aee-11e6-8606-0fffc56c6105</RequestId>\\n</ErrorResponse>\\n\"}\r\n\r\n\r\n```\r\n"}}
{"actor":{"display_login":"sarlindo"}}