如何为发电机创建 cloudwatch 警报?

时间:2021-06-17 20:04:34

标签: amazon-cloudformation amazon-cloudwatch

设置 - 在 cloudformation 模板中设置一个 dynamodb 和一个 lambda。我想在同一个模板中为 dynamo db 设置 ThrottledRequests 和延迟警报。谁有例子?

Resources:
  errorAlarm:
    Type: AWS::CloudWatch::Alarm
    Properties:
      AlarmName: error
      AlarmActions:
        - !Ref errorTopic
      MetricName: "Errors"
      Dimensions: 
      - Name: "FunctionName"
      - value: !Ref dbQueryLambda

  errorTopic:
    Type: AWS::SNS::Topic
    Properties:
      TopicName: error
      Subscription: 
      - Protocol: email
      - Endpoint: !Ref supportEmail
     
 dbTable:
      Type: AWS::DynamoDB::Table
      Properties:
        AttributeDefinitions:
          -
            AttributeName: "Bucket"
            AttributeType: "S"
          -
            AttributeName: "Key"
            AttributeType: "S"
 
        KeySchema:
          -
            AttributeName: "Bucket"
            KeyType: "HASH"
          - AttributeName: "Key"
            KeyType: "RANGE"
  

0 个答案:

没有答案