Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Proposal] Pure StepFunction #12

Open
claudiopastorini opened this issue Aug 14, 2018 · 0 comments
Open

[Proposal] Pure StepFunction #12

claudiopastorini opened this issue Aug 14, 2018 · 0 comments

Comments

@claudiopastorini
Copy link

claudiopastorini commented Aug 14, 2018

Similar to the Pure Lambda's Chalice support I propose to think about a new way to generate Step Functions through Domovoi.

I think that one big limit now is to support only one Step Function for a project. Another limit is that you cannot deploy a Step Function with all Resources defined somewhere (maybe through another Chalice project with @app.lambda_function() decorator).

In order to resolve these problems, I started to think about a new decorator that allows to generate a Step Function by only the state machine definition returned by it.

@app.step_function(state_machine_name="register-user")
def register():
    return REGISTER_USER_STEP_FUNCTION_DEFINITON

The step_function() decorator accepts one arg, an optional state_machine_name parameter if you don't want to use the python function name (very similar to the @app.lambda_function()) as Step Function name.

When you deploy the project Domovoi will create a new Step Function with the name {appname}-{stage}-{step_function_name}.

Doing this will allow us to define more than one Step Function inside the same project.

The step_function_task() decorator will remain but it will accept now another optional state_machine_name parameter that allow the user to give a name to the Step Function, if not provided will be used only the name {appname}-{stage}. You will be able to use both the step_function() and step_function_task() using the same step_function_name.

I started to work on it because I discovered the power of the Step Function and I want to be able to improve the performance of my already defined APIs using Chalice route() and lambda_function() decorators.

See #13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant