Skip to content

Latest commit

 

History

History
80 lines (63 loc) · 1.92 KB

File metadata and controls

80 lines (63 loc) · 1.92 KB

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.

serverless print

Options

  • None

Examples:

Assuming you have the following config file:

service: new-service
provider: google

custom:
  resource: projects/*/topics/my-topic

functions:
  first:
    handler: firstPubSub
    events:
      - event:
          eventType: providers/cloud.pubsub/eventTypes/topics.publish
          resource: ${self:custom.resource}
  second:
    handler: secondPubSub
    events:
      - event:
          eventType: providers/cloud.pubsub/eventTypes/topics.publish
          resource: ${self:custom.resource}

Using sls print will resolve the variables in the resource blocks:

$ sls print
service: new-service
provider: google

custom:
  resource: projects/*/topics/my-topic

functions:
  first:
    handler: firstPubSub
    events:
      - event:
          eventType: providers/cloud.pubsub/eventTypes/topics.publish
          resource: projects/*/topics/my-topic # <-- Resolved.
  second:
    handler: secondPubSub
    events:
      - event:
          eventType: providers/cloud.pubsub/eventTypes/topics.publish
          resource: projects/*/topics/my-topic # <-- Resolved.