Skip to content

Type Error: this.provider.getApiGatewayPredefinedResources is not a function #173

@yashwant

Description

@yashwant

This is a (Bug Report / Feature Proposal)

I am getting error when I try to deploy ServerLess function. Error log is as follows:

state machine [myStateMachine] : alarms config is malformed. Please see https://github.com/horike37/serverless-step-functions for examples

Type Error ---------------------------------------------

 this.provider.getApiGatewayPredefinedResources is not
 a function

 For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.

Stack Trace --------------------------------------------

TypeError: this.provider.getApiGatewayPredefinedResources is not a function
at ServerlessStepFunctions.getResourcePaths (node_modules/serverless-step-functions/lib/deploy/events/apiGateway/resources.js:61:47)
at ServerlessStepFunctions.compileResources (node_modules/serverless-step-functions/lib/deploy/events/apiGateway/resources.js:9:37)
From previous event:
at PluginManager.invoke (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:234:22)
at PluginManager.spawn (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:246:17)
at Deploy.BbPromise.bind.then (/usr/local/lib/node_modules/serverless/lib/plugins/deploy/deploy.js:79:48)
From previous event:
at Object.before:deploy:deploy [as hook] (/usr/local/lib/node_modules/serverless/lib/plugins/deploy/deploy.js:77:8)
at BbPromise.reduce (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:234:55)
at runCallback (timers.js:810:20)
at tryOnImmediate (timers.js:768:5)
at processImmediate [as _immediateCallback] (timers.js:745:5)
From previous event:
at PluginManager.invoke (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:234:22)
at PluginManager.run (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:253:17)
at variables.populateService.then (/usr/local/lib/node_modules/serverless/lib/Serverless.js:96:33)
From previous event:
at Serverless.run (/usr/local/lib/node_modules/serverless/lib/Serverless.js:87:74)
at serverless.init.then (/usr/local/lib/node_modules/serverless/bin/serverless:23:50)
at

Get Support --------------------------------------------
Docs: docs.serverless.com
Bugs: github.com/serverless/serverless/issues
Forums: forum.serverless.com
Chat: gitter.im/serverless/serverless

Your Environment Information -----------------------------
OS: darwin
Node Version: 8.15.0
Serverless Version: 1.13.2

For bug reports:

  • What went wrong?
  • What did you expect should have happened?
  • What was the config you used?
  • What stacktrace or error message from your provider did you see?

My serverless.yml file is as follows:

service: serverlessStepFunctions

plugins:

  • serverless-step-functions
  • serverless-pseudo-parameters

frameworkVersion: ">=1.1.0 <2.0.0"

provider:
name: aws
runtime: nodejs8.10
profile: ${file(./aws_params.yml):profile}
stage: ${file(./aws_params.yml):stage}
region: ${file(./aws_params.yml):region}
deploymentBucket: ${file(./aws_params.yml):DEPLOYMENT_S3_BUCKET}
versionFunctions: false
iamRoleStatements:
- Effect: "Allow"
Action: ":"
# - "states:StartExecution"
Resource:
- "*"

stackPolicy:
- Effect: Allow
Principal: ""
Action: "Update:
"
Resource: ""
- Effect: Deny
Principal: "
"
Action:
- Update:Replace
- Update:Delete
Condition:
StringEquals:
ResourceType:
- AWS::EC2::Instance

environment:
AccountId: ${file(./aws_params.yml):AccountId}

functions:
function1:
handler: handler.hello1
function2:
handler: handler.hello2
function3:
handler: handler.hello3
function4:
handler: handler.hello4
function5:
handler: handler.hello5

stepFunctions:
stateMachines:
hellostepfunc1:
name: myStateMachine
events:
- http:
path: function1
method: get
definition:
Comment: "An example of the Amazon States Language using an AWS Lambda Function"
StartAt: HelloWorld1
States:
HelloWorld1:
Type: Task
Resource: ""
End: true

My aws_params.yml config file is as follows:
region:
stage:
profile:
DEPLOYMENT_S3_BUCKET:
AccountId:

Additional Data

  • Serverless Framework Core Version you're using:
  • The Plugin Version you're using:
  • Operating System:
  • Stack Trace:
  • Provider Error messages:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions