title: How do I setup an alarm for CloudFront from CloudWatch in a CloudFormation yaml template?
body: <p>I want to setup an alarm in case an error occurs on CloudFront from CloudWatch. </p>
  
  <p>In the console, I would directly create an alarm that would send me an email in case the <code>TotalErrorRate</code> is larger than 0. This is working fine.</p>
  
  <p>But now I want to setup the same setting in a yaml template file in CloudFormation. I have trouble figuring out the right values for the corresponding parameters. My file currently looks like this:</p>
  
  <pre><code>  # CloudWatch
    CloudFrontTotalErrorRateAlarm:
      Type: "AWS::CloudWatch::Alarm"
      Properties:
        ActionsEnabled: Boolean
        AlarmActions:
          - String
        AlarmDescription: "Trigers an alarm if there is any error (e.g. 4xx,5xx)"
        AlarmName: "MyApiTotalErrorRate"
        ComparisonOperator: GreaterThanThreshold
        Dimensions:
          - Dimension
        EvaluationPeriods: "1"
        ExtendedStatistic: String
        InsufficientDataActions:
          - String
        MetricName: TotalErrorRate
        Namespace: AWS/CloudFront
        OKActions:
          - String
        Period: 60
        Statistic: String
        Threshold: 0
        TreatMissingData: String
        Unit: String
  </code></pre>
  
  <p>For some parameters, I could figure out what the actual value could be. But for others I essentially don't know what I should put in so that AWS would send me an email in case an error occurs. The following parameters are missing values:</p>
  
  <ul>
  <li><code>ActionsEnabled</code></li>
  <li><code>AlarmActions</code></li>
  <li><code>Dimensions</code></li>
  <li><code>ExtendedStatistic</code></li>
  <li><code>InsufficientDataActions</code></li>
  <li><code>OKActions</code></li>
  <li><code>Statistic</code></li>
  <li><code>TreatMissingData</code></li>
  <li><code>Unit</code></li>
  </ul>