title: cloudwatch alarm in boto3 gives error in unit
body: <p>I am trying to learn cloudwatch alarms on boto3 ,amazon ec2 instances how they can be programmed in custom scripts. </p>
  
  <pre><code>import boto3
  import time
  # Create CloudWatch client
  cloudwatch = boto3.client('cloudwatch')
  
  # Create alarm with actions enabled
  cloudwatch.put_metric_alarm(
      AlarmName='Web_Server_CPU_Utilization',
      ComparisonOperator='GreaterThanThreshold',
      EvaluationPeriods=1,
      MetricName='CPUUtilization',
      Namespace='AWS/EC2',
      Period=60,
      Statistic='Average',
      Threshold=70.0,
      ActionsEnabled=True,
      AlarmActions=[
        'arn:aws:swf:us-west-2:{CUSTOMER_ACCOUNT}:action/actions/AWS_EC2.InstanceId.Reboot/1.0'
      ],
      AlarmDescription='Alarm when server CPU exceeds 70%',
      Dimensions=[
          {
            'Name': 'InstanceId',
            'Value': 'INSTANCE_ID'
          },
      ],
      Unit='Seconds'
  )
  </code></pre>
  
  <p>However upon execution of above program I am getting error </p>
  
  <pre><code>Traceback (most recent call last):
    File "D:\expt2\cloudwatch alarm in action.py", line 27, in &lt;module&gt;
      Unit='Seconds'
    File "E:\installation2\python3\lib\site-packages\botocore\client.py", line 314, in _api_call
      return self._make_api_call(operation_name, kwargs)
    File "E:\installation2\python3\lib\site-packages\botocore\client.py", line 612, in _make_api_call
      raise error_class(parsed_response, operation_name)
  botocore.exceptions.ClientError: An error occurred (ValidationError) when calling the PutMetricAlarm operation: Unknown
  </code></pre>
  
  <p>This sample code which is giving me error ,how can I fix this?</p>