-
Notifications
You must be signed in to change notification settings - Fork 37
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
Offline function invoke (cross-project) + helper #10
Comments
@johncmckim Love the idea and initial design/goals! One thing I noticed:
What if the file includes more handlers? Might need some handler prefixing. |
@nicka so the idea is that we'll identify by service name + function name. So the key will be It does assume that this will be unique across an application (group of services). If we can set where the registry lives that should a reasonable assumption as they should be unique in AWS anyway. |
@johncmckim Not sure if we're talking about the same thing (or I'm not getting it haha). |
Oh sorry @nicka do you mean like I'm going to look at using dynamodb-local for the registry. |
@johncmckim perfect!!! |
I've ended up using |
Feature Proposal)
Description
When running functions locally, as soon as you access the
aws-sdk
all subsequent calls are made to the cloud. TheSERVERLESS_SIMULATE
environment variable as specified in #8 will allow people to avoid this by creating factories that change behaviour when running locally.For example, if you wanted to use DynamoDB or Memcached you could do the following.
But there is no simple way of achieving this for Lambda. This is because there is no registry of what functions exist where on a machine.
I suggest we add a
sls simulate register
command and aregister
lifecycle event toinvoke
andserve
. The register hook would store the functions + path in a common user file i.e.~/.serverless-simulate/registry
in the format{service:name}-{function:name}
.We can then create a helper that would access the registry and invoke functions across services.
Bonus
Support setting for where the registry lives
The text was updated successfully, but these errors were encountered: