Add informatin to "Serive Information" at end of deploy

After a sls deploy, the terminal prints out this information…

Service Information
service: CARDS
stage: dev
region: us-west-2
stack: CARDS-dev
api keys:
  None
endpoints:
  None
functions:
  graphql: CARDS-dev-graphql
Serverless: Removing old service versions...

How can I add to this information. I would like to provide some feedback (such as api keys or the id’s of some of the resources that have been created).

Are you looking for the output feature in serverless.yml? https://serverless.com/framework/docs/providers/aws/guide/serverless.yml/

  # The "Outputs" that your AWS CloudFormation Stack should produce.  This allows references between services.
  Outputs:
    UsersTableArn:
      Description: The ARN for the User's Table
      Value:
        "Fn::GetAtt": [ usersTable, Arn ]

You need run sls info -v to show the outputs.

I ended up using the plugin serverless-stack-output so I could do some custom logging at the end of a deploy and also reformat the outputs and save them to file.

1 Like