0

While installing serverless with following command sls plugin install -n serverless-alexa-skills --stage dev

I am getting an error like Your serverless.yml has an invalid value with key: "Ref"

The following is my sample serverless.yml file

plugins:
- serverless-webpack
- serverless-s3-sync
- serverless-plugin-git-variables
- serverless-alexa-skills

functions: ${file(./deploy/${opt:stage}.yml):functions}
resources: ${file(./deploy/${opt:stage}.yml):resources}
custom: ${file(./deploy/${opt:stage}.yml):custom}

outputs:
DialogflowFunctionArn:
Value:
  Ref: 

Got a block here. can some one help me here.

Nag
  • 679
  • 1
  • 5
  • 15

3 Answers3

2

Ref is a Cloudformation intrinsic function. It needs to reference a resource. The whole outputs section is also optional, use it only if you need to reference the resources from one stack in another.

Milan Cermak
  • 5,444
  • 2
  • 36
  • 51
1

It basically says that Ref: is expecting a value. You have defined it but not assigned any value to it. If there is no use then you should remove this part from your code:

outputs:
DialogflowFunctionArn:
Value:
  Ref:
0

Ref expects to reference something, right now you are not passing it anything to reference.

So, assuming you want the ARN of DialogflowFunction and that function config looks something like this in your functions file:

DialogflowFunction:
  description: get the flow
  handler: src/functions/dialog-controller.flow
  events:
    - http:
        path: '/dialog/flow'
        method: get
        cors: true

Then your ref would look something like this:

outputs:
DialogflowFunctionArn:
Value:
  Ref: DialogflowFunction

Ref takes the logical id of the resource for which you want to reference, in this case that is DialogflowFunction, and will return the ARN of that resource.

Justin Kruse
  • 668
  • 8
  • 24