serverless-step-functions icon indicating copy to clipboard operation
serverless-step-functions copied to clipboard

EventBridge // CloudWatch Event Rules Not Being Created

Open lctnstn opened this issue 3 years ago • 2 comments

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

lctnstn avatar Apr 22 '21 19:04 lctnstn

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

bayoudhi avatar Oct 22 '21 18:10 bayoudhi

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

Maxime-Deharbonnier avatar Dec 10 '21 15:12 Maxime-Deharbonnier