-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
invoke local
does not work with variable substitution in provider
#4817
Comments
Hey, this might be related to an issue I opened earlier today. #4814
Having at least something in the provider and then backfilling the rest of the data makes the script continue. |
@MacMcIrish This is probably a duplicate of #4814 What does |
Running
But, the deploy and packaging still work even if though the print doesn't have it backfilled |
I agree, I've got additional VPC, bucket name, and tags in the provider configuration that should be used, but are not reflected in the package ( I'd check and make sure your region is indeed set to us-west-2. (Note: |
@Omicron7 You're entirely right... That's unfortunate. Thanks for the heads up! |
I've written a plugin that does post variable substitution merge. serverless.yml service: service-name
provider:
name: aws
$<<: ${file(path/to/other.yml):provider} path/to/other.yml provider:
runtime: nodejs6.10
vpc:
... Will merge the service: service-name
provider:
name: aws
runtime: nodejs6.10
vpc:
... |
@Omicron7 Doesn't seem to resolve the issue unfortunately. The variables are still resolved incorrectly. Will post details shortly. |
@Omicron7 Considering how broken variable resolution + file inclusion currently is in serverless, we're considering implementing our own loading logic - possibly using |
We now do the following const path = require("path");
const optimist = require('optimist');
const loadYaml = require("lambda-serverless-api")().loadYaml;
module.exports = loadYaml(path.join(__dirname, "_serverless.yml"), optimist.argv); Extremely hacky, but at least you know what you get when using file references. Yaml loading is defined here. |
I've now separated this logic into yaml-boost |
Fixed with #8987 |
This is a Bug Report
Description
When running
sls invoke local
with variable substitution${}
in the provider configuration, nothing happens and the command exits.I expected the invoked function to be executed, or if the function could not be found, an error message describing that the function does not exist in this service.
Example using the hello-world template. (
serverless create --template hello-world
).Invoke local functions properly:
Changing serverless.yml to include variable substitution in the provider:
results in invoke local doing nothing.
It produces no output or error. Running with
SLS_DEBUG=*
enabled shows that commands are loaded, invoke:local is executed, but nothing happens. Providing an unknown function name results in the same response, no message or error.This is just an example that produces the results I'm running into. I'm using similar to change the provider configuration depending on wether serverless is being run in development or on our CI server.
The text was updated successfully, but these errors were encountered: