Nelson.b.austin
Nelson.b.austin

Reputation: 3190

Serverless framework outputs

I just want to be able to print out information I need for my app configuration. Starting with the basics: UserPoolId. Output is not working. Anyone know why?

service: test-ota-fmw

provider:
    name: aws
    runtime: nodejs8.10
    stage: dev

custom:
    stage: ${opt:stage, self:provider.stage}
    variables:
        facebook_app_id: fbappid
        google_app_id: xxxxx.apps.googleusercontent.com

resources:
    # Cognito
    # - ${file(resources/cognito-user-pool.yml)}
    # - ${file(resources/cognito-identity-pool.yml)}
    Resources:
        CognitoUserPool:
            Type: AWS::Cognito::UserPool
            Properties:
                UserPoolName: mgnio-${self:custom.stage}-user-pool
                UsernameAttributes:
                    - email
                AutoVerifiedAttributes:
                    - email
        CognitoUserPoolClient:
            Type: AWS::Cognito::UserPoolClient
            Properties:
                ClientName: mgnio-${self:custom.stage}-mobile-app-client
                GenerateSecret: true
                UserPoolId:
                    Ref: CognitoUserPool

    Outputs:
        UserPoolId:
            Value:
                Ref: CognitoUserPool

Output

Here is the output after running serverless deploy

Service Information
service: mgnio-ota-fmw
stage: dev
region: us-east-1
stack: mgnio-ota-fmw-dev
api keys:
  None
endpoints:
  None
functions:
  None

Apparently I have to add more text because it's complaining that my post is mostly code. I don't really know how to explain much further so I'm just going to continue to rant until I have enough text that StackOverflow stops yelling at me. Thanks!

Update I was able to get the output if I ran serverless deploy -v. Is this the expected behavior? Does the Output only display if the --verbose flag is set?

Upvotes: 2

Views: 5205

Answers (1)

Murali Allada
Murali Allada

Reputation: 22908

To make the serverless framework display any stack outputs, you need to use the -v or --verbose flag.

sls deploy -v 

or

sls info -v

See docs here.

Upvotes: 3

Related Questions