Fn - Workflow
Intro. Quick recommendations and tips for various processes.
- Write your functions
serverless deployonly when you've made changes to
serverless.ymland in CI/CD systems.
serverless deploy -f myFunctionto rapidly deploy changes when you are working on a specific Fn Function.
serverless invoke -f myFunction -lto test your Fn Functions.
- Write tests to run locally.
- Break your application/project into multiple Serverless Services.
- Model your Serverless Services around Data Models or Workflows.
- Keep the Functions and Resources in your Serverless Services to a minimum.
A handy list of commands to use when developing with the Serverless Framework.
Create A Service:
Creates a new Service
serverless create -p [SERVICE NAME] -t fn-nodejs
serverless create -p [SERVICE NAME] -t fn-go
Use this when you have made changes to your Functions, Events or Resources in
serverless.yml or you simply want to deploy all changes within your Service at the same time.
Use this to quickly overwrite your Fn Functions, allowing you to develop faster.
serverless deploy -f [FUNCTION NAME]
Invokes an Fn Function and returns logs.
serverless invoke -f [FUNCTION NAME] -l
Open up a separate tab in your console and stream all logs for a specific Function using this command.
serverless logs -f [FUNCTION NAME]