O'Reilly logo

DevOps for Serverless Applications by Shashikant Bangera

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Variables and plugins

Variables are the values that can be passed to the configuration values within the serverless.yml while running the Serverless Framework command. They need to pass reference values enclosed in ${} brackets, but you can use variables in property values rather than in the property keys. The following code shows how this is added in the serverless.yml file:  

provider:      name: aws      stage: ${opt:stage, 'dev'}

In the following statement, we pass the parameter to the CLI and the stage value is populated in the serverless.yml file:

$ serverless deploy --stage qa

The variables can be used recursively as reference properties—that is, we can combine multiple values and variable sources, as shown in the following environment variable:  ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required