As we saw, a service in serverless framework is a composition of Functions, Events, and Resources. To deploy the service for the first time, we use the following command:
sls deploy --aws-profile=lets-poll-default
A few things to note:
- sls is the shorthand for the serverless command.
- deploy is the command to package all the artifacts and submit it to CloudFormation to provision.
- --aws-profile is the flag to denote the profile that has to be used. Remember, we created a profile when configuring the serverless CLI in the previous section.
- This command is to be used when there is a configuration change that is to be deployed.