# Use shared API Gateway with serverless-aws-documentation

**URL:** <https://forum.serverless.com/t/use-shared-api-gateway-with-serverless-aws-documentation/3897>\
**Category:** Serverless Framework\
**Tags:** aws\
**Created:** [February 28, 2018, 12:50pm UTC](https://forum.serverless.com/t/use-shared-api-gateway-with-serverless-aws-documentation/3897 "2018-02-28T12:50:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pj035](https://avatars.discourse-cdn.com/v4/letter/p/e8c25b/32.png) [@pj035](https://forum.serverless.com/u/pj035)\
**Post date:** [February 28, 2018, 12:50pm UTC](https://forum.serverless.com/t/use-shared-api-gateway-with-serverless-aws-documentation/3897/1 "2018-02-28T12:50:54Z")

</div>

I have a project that is splitted into two services. The first service creates and defines an API gateway, whereas the latter one just uses it. I’ve followed the documentation [here](https://serverless.com/framework/docs/providers/aws/events/apigateway/#share-api-gateway-and-api-resources).

Service1 (creates the API Gateway)

```
frameworkVersion: "^1.26.0"

service: my-first-service

provider:
  name: aws
  runtime: nodejs6.10
   
functions:
  initDb:
    handler: handler.get_initDatabase
    events:
      - http:
          method: get
          path: init-database
          authorizer: aws_iam

```

Service2 (uses the API Gateway)

```
plugins:
  - serverless-plugin-typescript
  - serverless-reqvalidator-plugin
  - serverless-aws-documentation # <----- this seems to cause the problem
  - serverless-offline

frameworkVersion: "^1.26.0"

service: my-second-service

provider:
  name: aws
  runtime: nodejs6.10
  memorySize: 128 apiGateway:
    restApiId: ${env:REST_API_ID}
    restApiRootResourceId: ${env:REST_API_ROOT_RESOURCE_ID}

functions:
....
custom:
  documentation:
    ....

```

When I try to deploy Service2, the deployment fails with `The CloudFormation template is invalid: Template format error: Unresolved resource dependencies [ApiGatewayRestApi] in the Resources block of the template`. As soon as I comment out the `serverless-aws-documentation` plugin it works.  
Is this a plugin related problem?

Edit: I’ve also created an issue in their repo [https://github.com/9cookies/serverless-aws-documentation/issues/72](https://github.com/9cookies/serverless-aws-documentation/issues/72)
