serverless-operations / serverless-step-functions

AWS Step Functions plugin for Serverless Framework ⚡️
Other
1.03k stars 207 forks source link

EventBridge // CloudWatch Event Rules Not Being Created #421

Open lctnstn opened 3 years ago

lctnstn commented 3 years ago

The service deploys fine but completely ignores/skips over ccreating EventBridge and CloudWatch event rules.

Framework Core: 2.30.3
Plugin: 4.5.1
SDK: 4.2.0
Components: 3.7.5
service: sample

frameworkVersion: '2'

plugins:
  - serverless-step-functions

provider:
  name: aws
  runtime: python3.8
  lambdaHashingVersion: 20201221
  stage: dev

functions:
  hello:
    handler: handler.hello

stepFunctions:
  stateMachines:
    sampleMachine:
      events:
        - eventBridge:
          event:
            source:
              - "aws.workspaces"
            detail-type:
              - "AWS API Call via CloudTrail"
            detail:
              eventSource:
                - "workspaces.amazonaws.com"
              EventName:
                - CreateWorkspaces
                - CreateTags
                - DeleteTags
      definition:
        StartAt: HelloWorld
        States:
          HelloWorld:
            Type: Task
            Resource: !GetAtt hello.Arn
            End: true
bayoudhi commented 3 years ago

Hi @lctnstn I think you have a problem with the yaml format, eventBridge and event should not in the same level.

Bad

stepFunctions:
  stateMachines:
    sampleMachine:
      events:
        - eventBridge:
          event:
            source:
              - "aws.workspaces"
            detail-type:
              - "AWS API Call via CloudTrail"
            detail:
              eventSource:
                - "workspaces.amazonaws.com"
              EventName:
                - CreateWorkspaces
                - CreateTags
                - DeleteTags

Good

stepFunctions:
  stateMachines:
    sampleMachine:
      events:
        - eventBridge:
            event:
              source:
                - "aws.workspaces"
              detail-type:
                - "AWS API Call via CloudTrail"
              detail:
                eventSource:
                  - "workspaces.amazonaws.com"
                EventName:
                  - CreateWorkspaces
                  - CreateTags
                  - DeleteTags
Maxime-Deharbonnier commented 2 years ago

Hello, we had the same issue and it works well, thanks a lot.