0.1.3 • Published 6 years ago

dynamodb-alarms-plugin v0.1.3

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

Create Cloudwatch alarms for all DynamoDB tables' read and write capacity.

Usage

In Serverless template:

plugins:
  - dynamodb-alarms-plugin

custom:
  dynamo-alarms:
    ReadCapacityPercent: 80
    WriteCapacityPercent: 80
    Period: 60
    EvaluationPeriods: 1
    TopicName: snsNotificationTopic

Example

service: dynamo-alarm-plugin

provider:
  name: aws
  runtime: nodejs6.10
  stage: ${opt:stage, 'dev'}
  region: us-east-1

plugins:
  - dynamodb-alarms-plugin

custom:
  dynamo-alarms:
    ReadCapacityPercent: 80
    WriteCapacityPercent: 80
    Period: 60
    EvaluationPeriods: 1
    TopicName: snsNotificationTopic

resources:
  Resources:
    snsNotificationTopic:
      Type: AWS::SNS::Topic
      Properties:
        DisplayName: DynamoErrorsToSns
        Subscription:
        - Endpoint: user@example.com
          Protocol: email
    tableToWatch:
      Type: AWS::DynamoDB::Table
      Properties:
        TableName: table-alarm-test-${self:provider.stage}
        AttributeDefinitions:
          - AttributeName: recordId
            AttributeType: S
        KeySchema:
          - AttributeName: recordId
            KeyType: HASH
        ProvisionedThroughput:
          ReadCapacityUnits: '5'
          WriteCapacityUnits: '5'
        Tags:
           - Key: MyTag1
             Value: MyTagValue1