title: How to update existing cloudwatch ALARM using boto?
body: <p>I have some existing cloudwatch alarms in AWS , i have successfully exracted them and stored them in a list of dicts as follows:</p>
  
  <pre><code>[   {   'alarm_name': u'emsclassicldap_db_connections',
          'alarm_threshold': 200.0,
          'rds_name': u'emsclassicldap',
          'rds_type': u'db.m3.medium'},
      {   'alarm_name': u'smso-jenkins-40-shared_db_connections',
          'alarm_threshold': 266.0,
          'rds_name': u'smso-jenkins-40-shared',
          'rds_type': u'db.m3.medium'},
      {   'alarm_name': u'smso-jenkins-master-shared_db_connections',
          'alarm_threshold': 266.0,
          'rds_name': u'smso-jenkins-master-shared',
          'rds_type': u'db.m3.large'},
      {   'alarm_name': u'syd01-devops-deepali-shared_db_connections',
          'alarm_threshold': 266.0,
          'rds_name': u'syd01-devops-deepali-shared',
          'rds_type': u'db.m3.medium'}]
  </code></pre>
  
  <p>The above if a simple list and nothing fancy. Now i have some of the above alarms have some wrong <code>alarm_threshold</code> values which need to be updated with the following standard right ones:</p>
  
  <pre><code>thershold_db_t2_medium = 309  # 99% of 312
  thershold_db_m3_medium = 316  # 99% of 320
  thershold_db_m3_large  = 633  # 99% of 640
  thershold_db_m3_xlarge = 1267  # 99% of 1280
  thershold_db_m3_2xlarge= 2534  # 99% of 2560
  thershold_db_m4_large  = 675  # 99% of 682
  thershold_db_m4_xlarge = 1351  # 99% of 1365
  thershold_db_m4_2xlarge=  2703  # 99% of 2730
  </code></pre>
  
  <p>I wrote the following to update the alarm</p>
  
  <pre><code>my_region_list=['ap-southeast-2']
  def final_compare_update(w):
      for region in my_region_list:
          c = boto.ec2.cloudwatch.connect_to_region(region)
          for each_dict in w:
           #print each_dict['rds_type']
               if each_dict['rds_type']=="db.m2.medium" and each_dict['alarm_threshold'] != thershold_db_t2_medium:
                  c.update_alarm(name=each_dict['alarm_name'],comparision='&gt;=',threshold=thershold_db_t2_medium, period=300, evaluation_periods=3,statistic='Maximum')
                  print "updated "+each_dict['alarm_name']
               elif each_dict['rds_type']=="db.m3.medium" and each_dict['alarm_threshold'] != thershold_db_m3_medium:
                  c.update_alarm(name=each_dict['alarm_name'], comparision='&gt;=', threshold=thershold_db_m3_medium,period=300, evaluation_periods=3, statistic='Maximum')
                  print "updated " + each_dict['alarm_name']
               elif each_dict['rds_type'] == "db.m3.large" and each_dict['alarm_threshold'] != thershold_db_m3_large:
                  c.update_alarm(name=each_dict['alarm_name'], comparision='&gt;=', threshold=thershold_db_m3_large, period=300,evaluation_periods=3, statistic='Maximum')
                  print "updated " + each_dict['alarm_name']
               elif each_dict['rds_type'] == "db.m3.xlarge" and each_dict['alarm_threshold'] != thershold_db_m3_xlarge:
                  c.update_alarm(name=each_dict['alarm_name'], comparision='&gt;=', threshold=thershold_db_m3_xlarge,period=300,evaluation_periods=3, statistic='Maximum')
                  print "updated " + each_dict['alarm_name']
               elif each_dict['rds_type'] == "db.m3.2xlarge" and each_dict['alarm_threshold'] != thershold_db_m3_2xlarge:
                  c.update_alarm(name=each_dict['alarm_name'], comparision='&gt;=', threshold=thershold_db_m3_2xlarge,period=300, evaluation_periods=3, statistic='Maximum')
                  print "updated " + each_dict['alarm_name']
               elif each_dict['rds_type'] == "db.m4.large" and each_dict['alarm_threshold'] != thershold_db_m4_large:
                   c.update_alarm(name=each_dict['alarm_name'], comparision='&gt;=', threshold=thershold_db_m4_large,period=300, evaluation_periods=3, statistic='Maximum')
                   print "updated " + each_dict['alarm_name']
               elif each_dict['rds_type'] == "db.m4.xlarge" and each_dict['alarm_threshold'] != thershold_db_m4_xlarge:
                   c.update_alarm(name=each_dict['alarm_name'], comparision='&gt;=', threshold=thershold_db_m4_xlarge,period=300, evaluation_periods=3, statistic='Maximum')
                   print "updated " + each_dict['alarm_name']
               elif each_dict['rds_type'] == "db.m4.2xlarge" and each_dict['alarm_threshold'] != thershold_db_m4_2xlarge:
                   c.update_alarm(name=each_dict['alarm_name'], comparision='&gt;=', threshold=thershold_db_m4_2xlarge,period=300, evaluation_periods=3, statistic='Maximum')
                   print "updated " + each_dict['alarm_name']
               else:
                   print "Nothing was updated!"
  </code></pre>
  
  <p>This throws me ERROR:</p>
  
  <pre><code>Traceback (most recent call last):
    File "update_alarm.py", line 128, in &lt;module&gt;
      final = final_compare_update(w)
    File "update_alarm.py", line 88, in final_compare_update
      c.update_alarm(name=each_dict['alarm_name'], comparision='&gt;=', threshold=thershold_db_m3_medium,period=300, evaluation_periods=3, statistic='Maximum')
  TypeError: put_metric_alarm() got an unexpected keyword argument 'name'
  </code></pre>
  
  <p>how to do so?</p>