Read this on the main serverless docs site¶
Print¶
Print your serverless.yml config file with all variables resolved.
If you're using Serverless Variables in your serverless.yml, it can be difficult to know if your syntax is correct or if the variables are resolving as you expect.
With this command, it will print the fully-resolved config to your console.
Options¶
formatPrint configuration in given format ("yaml", "json", "text"). Default: yamlpathPeriod-separated path to print a sub-value (eg: "provider.name")transformTransform-function to apply to the value (currently only "keys" is supported)
Examples:¶
Assuming you have the following config file:
service: new-service
provider: openwhisk
custom:
globalSchedule: cron(0 * * * *)
functions:
hello:
handler: handler.hello
events:
- schedule: ${self:custom.globalSchedule}
world:
handler: handler.world
events:
- schedule: ${self:custom.globalSchedule}
Using sls print will resolve the variables in the schedule blocks.
$ sls print
service: new-service
provider: openwhisk
custom:
globalSchedule: cron(0 * * * *)
functions:
hello:
handler: handler.hello
events:
- schedule: cron(0 * * * *) # <-- Resolved
world:
handler: handler.world
events:
- schedule: cron(0 * * * *) # <-- Resolved
This prints the provider name:
And this prints all function names: