Add a `serverelss function <action>` command
See original GitHub issueThis is a Feature Proposal
Description
To help keep parity with the new serverless plugin <action>
command we should introduce a serverless function <action>
command. There was consensus that the grouping of actions under a specific <object>
makes more sense and is easier to understand. https://github.com/serverless/serverless/pull/4046
The first commands that would be available are the ones that already exist.
serverless function deploy
serverless function rollback
However, this will leave room for adding such commands as…
serverless function install
serverless function publish
...
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Deploy Function - AWS Lambda - Serverless Framework
This command simply swaps out the zip file that your CloudFormation stack is pointing toward. This is a much faster way of deploying...
Read more >AWS Lambda Functions - Serverless Framework
All of the Lambda functions in your serverless service can be found in serverless.yml under the functions property.
Read more >Invoke Local - AWS Lambda - Serverless Framework
The invoke local command sets reasonable environment variables for the invoked function. All AWS specific variables are set to values that are quite...
Read more >Serverless Framework Commands - AWS Lambda - Invoke
--function or -f The name of the function in your service that you want to invoke locally. · --path or -p The path...
Read more >Serverless Framework Commands - AWS Lambda - Deploy
The sls deploy command deploys your entire service via CloudFormation. Run this command when you have made infrastructure changes (i.e., you edited serverless....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
There can be multiple cases for that - here with some solutions:
deploy:function
only asfunction:deploy
(a move!) entrypoints can help. You just have to declare the olddeploy:function
as entrypoint, so that it is not accessible from the CLI anymore, but declare an alias for itfunction:deploy
. This will automatically make the old command hidden, but the new command public.Slightly disagree here, as aliases do not invent/implement their own lifecycles but start the original command’s lifecycles. To have a clear overview of aliases I can extend my lifecycle cheat sheet to show the aliases too. So any plugin author has all information at hand. Also documenting the behavior should not be very complex.
I rethought a bit over this again. Now I’m pretty sure that these kind of command changes can indeed be done in a non-breaking way. The key is to introduce command aliases, i.e. existing commands could define aliases which just invoke the existing commands without the need to implement the alias command at all. This would be the most compatible and non-breaking approach and will allow to make commands available under different paths and commands,
The definition of such an alias would be quite simple:
The alias command implementation is easy and local to
pluginManager
, i.e. when loading plugins and their commands, the pluginManager would also parse the aliases array and setup the alias commands in the commands collection with their hooks just being duplicates of the original command’s hook. This would be stable and non-breaking - and best of all, also plugins can integrate with this mechanism. The need to discuss risky command movements or changes will be eliminated completely then and all command changes will be non-breaking in nature.The Serverless help could be changed to display commands along with their aliases or only aliases, whatever makes more sense.
@pmuens @eahefnawy What do you think about this approach? I think I can get a PR up and running in just a few days (hours?) as it is really easy.