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

Run template step function and mock resource #35

Closed
asyba opened this issue Nov 22, 2018 · 6 comments
Closed

Run template step function and mock resource #35

asyba opened this issue Nov 22, 2018 · 6 comments

Comments

@asyba
Copy link

asyba commented Nov 22, 2018

Hi, this tool can help me doing this local test:
I want to test the step function logic, I have the template yml/json, can I use stepfuntions-local to execute that template locally?
And then replace the resource arn with local lambdas running? (the local lambda will only return some json info to test the InputPath and ResultPath of the step function logic).

@ChristopheBougere
Copy link
Owner

Hi @asyba, sorry for the delay.
Yep you should be able to do all of that with stepfunctions-local.
Here is an example with local lambdas on localstack, it should work the same with another local lambda server:
https://github.com/airware/stepfunctions-local/wiki/Lambdas-deployed-on-Localstack
Feel free to reopen if you encounter any error.

@asyba
Copy link
Author

asyba commented Jan 7, 2019

@ChristopheBougere One question about "stepfunctions-local does not aim to emulate Lambda. To do this you need a local Lambda server that is compliant to AWS API. We recommand to use localstack for that. See how to here."
Can I use "serverless offline" or "sam cli local" to have my lambda locally and with stepfunctions-local ? or only "localstack" can work?

@ChristopheBougere
Copy link
Owner

AFAIK, serverless-offline is a combination of Lambda and API Gateway and provides an HTTP endpoint which simulates the API Gateway endpoint.
But there is no local Lambda server (that you could run with aws lambda --endpoint http://localhost:{LAMBDA_PORT}) so I don't think it would work.
I would assume it is the same for AWS SAM local (the lambda engine is docker-lambda, which does not provide a lambda HTTP server), but this is to be confirmed.

@asyba
Copy link
Author

asyba commented Jan 7, 2019

Yes you are right, it seems that SAM is not supported (aws/aws-sam-cli#174) and also there is no way I think to connect "stepfunctions-local" with an ARN of a lambda that is running in SAM local..
I will have to learn to use localstack.

@ChristopheBougere
Copy link
Owner

Yep we made the choice when designing this package to only focus on the step functions layer and leveraging other packages for the lambda layer.
That way we can support every runtime and lambda feature natively (as long as they are supported by the lambda emulator).
Note that you can also deploy your lambdas on AWS, and run stepfunctions-local with these distant lambdas. But I guess it isn't what you are looking for.

@pianomansam
Copy link

I believe serverless offline now has support for invoking lambda functions with AWS SDK.

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

3 participants