serverless-plugin-aws-alerts icon indicating copy to clipboard operation
serverless-plugin-aws-alerts copied to clipboard

Add support for step functions alarms

Open bhedia opened this issue 2 years ago • 1 comments

Feature Proposal

Serverless supports deploying AWS Step Functions, but this plugin does not seem to support adding CW alarms for Step Functions.

When I try to use this plugin to configure alarms for step functions, here's what I get:

serverless.yaml:

custom:
  regionAlias: ${opt:regionAlias, 'uw1'}
  alerts:
    topics:
      alarm:
        topic: arn:aws:sns:#{AWS::Region}:#{AWS::AccountId}:alarm-topic-${self:provider.stage}
    definitions:
      executionsTimedOut:
        namespace: 'AWS/States'
        metric: ExecutionsTimedOut
        threshold: 1
        statistic: Sum
        period: 3600
        evaluationPeriods: 1
        datapointsToAlarm: 1
        comparisonOperator: GreaterThanOrEqualToThreshold
        treatMissingData: missing
    alarms:
      - executionsTimedOut

stepFunctions:
  stateMachines:
    helloWorld:
      alarms:
        - executionsTimedOut
      definition:
        StartAt: SayHelloWorld
        States:
          SayHelloWorld:
            Type: Pass
            End: true

Error: State machine [helloWorld] is malformed. Please check the README for more info. ValidationError: child "alarms" fails because ["alarms" must be an object]

bhedia avatar Mar 23 '22 20:03 bhedia

For the ones that are looking for including alarms for step functions. The step function plugin already provides it built-in: https://www.serverless.com/plugins/serverless-step-functions#cloudwatch-alarms

hdinizribeiro avatar Aug 22 '23 14:08 hdinizribeiro