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

Support InputTransformer for Cloudwatch Events

Open kumaresansv opened this issue 7 years ago • 4 comments

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:

  • What is the use case that should be solved. The more detail you describe this in the easier it is to understand for us. Allow transformation of the event input generated by Cloudwatch.

  • If there is additional config how would it look events: - schedule: name: <ScheduleName> description: 'Cyclic Daily 8 PM PST' rate: cron(0 4 * * ? *) inputTransformer: inputPathsMap: '<inputMapping>' inputTemplate: '<customInputTemplate'

Additional Data

  • Serverless Framework Core Version you're using: 1.24.1
  • The Plugin Version you're using: Latest
  • Operating System: Windows
  • Stack Trace:
  • Provider Error messages:

kumaresansv avatar Jan 30 '18 23:01 kumaresansv

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:

horike37 avatar Jan 31 '18 01:01 horike37

👍

owain68 avatar Dec 31 '19 13:12 owain68

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"}'

kabo avatar Jun 30 '21 03:06 kabo

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

zirkelc avatar Jul 12 '21 12:07 zirkelc