serverless-operations / serverless-step-functions

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

Set the TimeoutSeconds for Task states #239

Open theburningmonk opened 5 years ago

theburningmonk commented 5 years ago

This is a Feature Proposal

Description

One constant pain point with Step Functions is that Lambda time outs are not captured by States.timeout. You'd need to set TimeoutSeconds explicitly and make it match the Lambda function's timeout - easy to forget and confusing as hell every time I had to explain to a newcomer that "Lambda timeouts are not treated as timeouts in Step Functions, you gotta do this...".

Since we have the configuration for every function that we're ref'ng directly in the project, we can automatically inject the TimeoutSeconds to Task states.

This shouldn't be a breaking change, so we can make it a configuration option, e.g.

stepFunctions:
  stateMachines:
    myStateMachine:
      name: blah
      configureTaskTimeouts: true # defaults to false to keep backward compatibility
      definition: ...      
theburningmonk commented 5 years ago

@horike37 what do you think?

horike37 commented 5 years ago

@theburningmonk That functionality looks good 👍 And 100% agree with adding configureTaskTimeouts statement. Thanks for the proposal as always!