Deploying the entire Service

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.

Get Hands-On Serverless Applications with Kotlin now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.