# Issue creating Cloudwatch alarms

**URL:** <https://forum.ansible.com/t/issue-creating-cloudwatch-alarms/16588>\
**Category:** Ansible Project\
**Tags:** aws\
**Created:** [October 23, 2014, 9:44am UTC](https://forum.ansible.com/t/issue-creating-cloudwatch-alarms/16588 "2014-10-23T09:44:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stephen\_Gargan](https://avatars.discourse-cdn.com/v4/letter/s/c67d28/32.png) [@Stephen\_Gargan](https://forum.ansible.com/u/Stephen_Gargan)\
**Post date:** [October 23, 2014, 9:44am UTC](https://forum.ansible.com/t/issue-creating-cloudwatch-alarms/16588/1 "2014-10-23T09:44:03Z")

</div>

I’m trying to create some alarms using the metrics module. I’m using pretty much the exact example given in the docs

- name: create alarm  
ec2\_metric\_alarm:  
state: present  
region: us-west-2  
name: “cpu-low”  
metric: “CPUUtilization”  
namespace: “AWS/EC2”  
statistic: Average  
comparison: “\<=”  
threshold: 5.0  
period: 300  
evaluation\_periods: 3  
unit: “Percent”  
description: "This will alarm when a bamboo slave’s cpu usage average is lower than 5% for 15 minutes "  
dimensions: {‘InstanceId’:‘{{ansible\_ec2\_instance\_id}}’}  
alarm\_actions: [‘{{alarm\_sns}}’]

But I get a failure from boto saying that the security token is unexpected.

File “/usr/lib/python2.7/dist-packages/boto/regioninfo.py”, line 62, in connect

return self.connection\_cls(region=self, \*\*kw\_params)  
TypeError: **init** () got an unexpected keyword argument ‘security\_token’

I’ve tried setting and unsetting the access and secret keys but this makes no difference. I’m running from a checkout,

ansible 1.8 (devel 707474a43a) last updated 2014/10/22 15:22:23 (GMT +100)  
lib/ansible/modules/core: (detached HEAD 88b73afcbe) last updated 2014/10/22 17:32:44 (GMT +100)  
lib/ansible/modules/extras: (detached HEAD a0df36c6ab) last updated 2014/10/22 17:33:05 (GMT +100)  
v2/ansible/modules/core: (detached HEAD cb69744bce) last updated 2014/10/22 17:32:17 (GMT +100)  
v2/ansible/modules/extras: (detached HEAD 8a4f07eecd) last updated 2014/10/22 17:32:32 (GMT +100)  
configured module search path = None

And have boto 2.33 installed.

Anyone seen this or know what might be up?

Thanks,

Steve.

---

<div class="post-metadata">

**Author:** ![James\_Cammarata](https://avatars.discourse-cdn.com/v4/letter/j/7c8e57/32.png) [@James\_Cammarata](https://forum.ansible.com/u/James_Cammarata)\
**Post date:** [October 23, 2014, 3:07pm UTC](https://forum.ansible.com/t/issue-creating-cloudwatch-alarms/16588/2 "2014-10-23T15:07:40Z")

</div>

Hi Stephen,

That’s a very odd error, since the boto docs ([http://boto.readthedocs.org/en/latest/ref/cloudwatch.html](http://boto.readthedocs.org/en/latest/ref/cloudwatch.html)) show that security\_token is, in fact, a valid parameter for the connection. Looking at some older versions of the doc, that param was not listed in the cloudwatch connection class so you may want to verify there are not multiple versions of boto installed.

Alternatively, since I see you’re not running this as a local\_action or “delegate\_to: localhost”, make sure you have the correct version of boto installed on the system where the module is executing, assuming your “- hosts:” list is not localhost.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [October 24, 2014, 1:22pm UTC](https://forum.ansible.com/t/issue-creating-cloudwatch-alarms/16588/3 "2014-10-24T13:22:11Z")

</div>

Also, a traceback is always a bug, please file a ticket on this in the ansible/ansible-modules-core repo so we can catch it.
