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
Serverless Variables #1834
Serverless Variables #1834
Conversation
|
||
``` | ||
|
||
In the previous example you're dynamically adding a prefix to the function names by referencing the `stage` option that you pass in the CLI. So when you deploy, the function name will always include the stage you're deploying to. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might want to add an actual example CLI command. For example: sls deploy --stage=dev
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure thing. Note though that the command hasn't changed. It's still sls deploy --stage dev
as usual, but what's new is that you have access to this stage
CLI option in the configuration file.
Just played around with it and it's really rock solid! Here's just something I was wondering when using This way we can also e.g. access properties which are nested inside the events array like Another thing was that I still found several |
@pmuens not sure I understand what you mean about JSON. The |
Yes. Just something random I stumbled upon when I tried to access the Maybe a wrong usage on my side but also not a high priority IMHO. |
56176d2
to
3946ff5
Compare
Awesome! Will test it ASAP. Just one note. Could you do another global search for |
@pmuens Good catch! 👍 .... I was only searching in the docs folder |
@eahefnawy please resolve conflicts |
@eahefnawy You are so fantastic and talented, I bet you can still squeeze in support for Also, @maciej will give you a kiss. |
serverless.yml when I run, error happens. Serverless Error ---------------------------------------
... |
serverless.yml (the ./foo/function.yml is defined correctly) Type Error ---------------------------------------------
Could I know how to resolve it? I really want to define the functions in the sub folder. |
This PR implements the new Serverelss Variables system as described here and discussed in #1801.
${env:my_arn}
${opt:stage}
${self:service}
${env:${opt:stage}_arn}
${file(./config.yml):data.subProp}
cc/ @serverless/vip