serverless-operations / serverless-step-functions

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

Support InputTransformer for Cloudwatch Events #102

Open kumaresansv opened 6 years ago

kumaresansv commented 6 years ago

This is a Feature Proposal

Step functions could be launched from a Cloudwatch event. AWS allows us to transform the event data before passing it to the Step Function. This library is missing the usage of InputTransformer https://docs.aws.amazon.com/AmazonCloudWatchEvents/latest/APIReference/API_InputTransformer.html For feature proposals:

Additional Data

horike37 commented 6 years ago

Thank you for the proposal @kumaresansv :+1: That sounds good. I just added help wanted tag so that someone can pick it up and start to implement :smile:

owain68 commented 4 years ago

👍

kabo commented 3 years ago

Until this gets fixed here's a temporary workaround you can add to your serverless.yml.

resources:
  Resources:
    MyStepfunctionStepFunctionsEventsRuleSchedule1:
      Properties:
        Targets:
          - Arn:
              Ref: MyStepfunction
            Id: MyStepfunctionStepFunctionsSchedule
            RoleArn:
              Fn::GetAtt:
                - MyStepfunctionScheduleToStepFunctionsRole
                - Arn
            InputTransformer:
              InputPathsMap:
                now: "$.time"
              InputTemplate: '{"now": "<now>", "other": "things", "and": "stuff"}'
zirkelc commented 3 years ago

I would take this issue over if there's a chance the fix makes it back into the package?