deliveryhero / serverless-aws-documentation

Serverless 1.0 plugin to add documentation and models to the serverless generated API Gateway
MIT License
309 stars 148 forks source link

not working when trying to use existing API gateway #77

Closed malikadit closed 6 years ago

malikadit commented 6 years ago

Hi, I am trying to reuse an API gateway created in another serverless file. When I reuse the api created I get

Serverless Error ---------------------------------------

Invalid stage identifier specified

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

ServerlessError: Invalid stage identifier specified at BbPromise.fromCallback.catch.err (/usr/local/lib/node_modules/serverless/lib/plugins/aws/provider/awsProvider.js:258:33) From previous event: at persistentRequest (/usr/local/lib/node_modules/serverless/lib/plugins/aws/provider/awsProvider.js:247:13) at doCall (/usr/local/lib/node_modules/serverless/lib/plugins/aws/provider/awsProvider.js:205:9) at BbPromise (/usr/local/lib/node_modules/serverless/lib/plugins/aws/provider/awsProvider.js:216:14) From previous event: at persistentRequest (/usr/local/lib/node_modules/serverless/lib/plugins/aws/provider/awsProvider.js:203:38) at Object.request.requestQueue.add [as promiseGenerator] (/usr/local/lib/node_modules/serverless/lib/plugins/aws/provider/awsProvider.js:237:49) at Queue._dequeue (/usr/local/lib/node_modules/serverless/node_modules/promise-queue/lib/index.js:153:30) at /usr/local/lib/node_modules/serverless/node_modules/promise-queue/lib/index.js:109:18 From previous event: at Queue.add (/usr/local/lib/node_modules/serverless/node_modules/promise-queue/lib/index.js:94:16) at AwsProvider.request (/usr/local/lib/node_modules/serverless/lib/plugins/aws/provider/awsProvider.js:237:39) at aws.request.then.then.then.then.then.then (/builds/syn-drive/drive-src/rbc.drive.channel.api.mobile/node_modules/serverless-aws-documentation/src/documentation.js:132:25) From previous event: at ServerlessAWSDocumentation._updateDocumentation (/builds/syn-drive/drive-src/rbc.drive.channel.api.mobile/node_modules/serverless-aws-documentation/src/documentation.js:132:10) at ServerlessAWSDocumentation._buildDocumentation (/builds/syn-drive/drive-src/rbc.drive.channel.api.mobile/node_modules/serverless-aws-documentation/src/documentation.js:203:19) From previous event: at ServerlessAWSDocumentation.afterDeploy (/builds/syn-drive/drive-src/rbc.drive.channel.api.mobile/node_modules/serverless-aws-documentation/src/index.js:66:7) at BbPromise.reduce (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:372:55) From previous event: at PluginManager.invoke (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:372:22) at PluginManager.run (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:403:17) at variables.populateService.then (/usr/local/lib/node_modules/serverless/lib/Serverless.js:102:33) at runCallback (timers.js:651:20) at tryOnImmediate (timers.js:624:5) at processImmediate [as _immediateCallback] (timers.js:596:5) From previous event: at Serverless.run (/usr/local/lib/node_modules/serverless/lib/Serverless.js:89:74) at serverless.init.then (/usr/local/lib/node_modules/serverless/bin/serverless:42:50)

serverless file serverlesssample.txt

When I create a new API gateway however things are deployed fine. Does the serverless aws documentation not work in sharing mode. I need to split my serverless file and reuse the same API gateway.

dspasojevic commented 6 years ago

I am also trying to reuse a shared API Gateway.

For me, https://github.com/9cookies/serverless-aws-documentation/blob/master/src/index.js#L52

    this.cfTemplate.Outputs.AwsDocApiId = {
      Description: 'API ID',
      Value: {
        Ref: 'ApiGatewayRestApi',
      },
    };

seems problematic, as that reference can not be resolved in the CF template.

dspasojevic commented 6 years ago

Sorry, I didn't see #72 - I think that is the issue I am experiencing.

tchock commented 6 years ago

Ok, I will just close this. In case it is something different, just tell and I will open it again :)