# Wrapping up the Best Practices

**URL:** <https://discourse.sst.dev/t/wrapping-up-the-best-practices/1340>\
**Category:** Chapter Comments\
**Created:** [October 9, 2019, 2:10am UTC](https://discourse.sst.dev/t/wrapping-up-the-best-practices/1340 "2019-10-09T02:10:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jayair](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/jayair/32/9_2.png) [@jayair](https://discourse.sst.dev/u/jayair)\
**Post date:** [October 9, 2019, 2:10am UTC](https://discourse.sst.dev/t/wrapping-up-the-best-practices/1340/1 "2019-10-09T02:10:37Z")

</div>

Link to chapter - [https://serverless-stack.com/chapters/wrapping-up-the-best-practices.html](https://serverless-stack.com/chapters/wrapping-up-the-best-practices.html)

---

<div class="post-metadata">

**Author:** ![cranni](https://avatars.discourse-cdn.com/v4/letter/c/8e7dd6/32.png) [@cranni](https://discourse.sst.dev/u/cranni)\
**Post date:** [April 4, 2020, 5:42pm UTC](https://discourse.sst.dev/t/wrapping-up-the-best-practices/1340/2 "2020-04-04T17:42:56Z")

</div>

I am attempting to expand the tutorial to include a /notes2-api as part of the project. I can’t seem to edit the notes2 serverless.yml to create it. I can create it as a separate url. but can’t figure out how to create it so there is a structure:

/billing  
/notes  
/notes2

I use parts of the billing-api yml such as the api imports

apiGateway:  
restApiId:  
‘Fn::ImportValue’: {self:custom.stage}-ExtApiGatewayRestApiId restApiRootResourceId: 'Fn::ImportValue': {self:custom.stage}-ExtApiGatewayRestApiRootResourceId

**but it still fails with:**  
**The CloudFormation template is invalid: Template format error: Unresolved resource dependencies [ApiGatewayRestApi] in the Resources block of the template.**

I obviously have something wrong that causes the error in the cloudformation template, but I don’t see many moving parts and which ones need some change to get the correct values.

notes2 serverless.yml

```
service: notes-app-ext-notes2-api

plugins:
  - serverless-bundle
  - serverless-offline

custom: ${file(../../serverless.common.yml):custom}

package:
  individually: true

provider:
  name: aws
  runtime: nodejs10.x
  stage: dev
  region: us-west-2
  tracing:
    lambda: true

  apiGateway:
    restApiId:
      'Fn::ImportValue': ${self:custom.stage}-ExtApiGatewayRestApiId
    restApiRootResourceId:
      'Fn::ImportValue': ${self:custom.stage}-ExtApiGatewayRestApiRootResourceId    

  environment:
    stage: ${self:custom.stage}
    resourcesStage: ${self:custom.resourcesStage}

  iamRoleStatements:
    - ${file(../../serverless.common.yml):lambdaPolicyXRay}
    - Effect: Allow
      Action:
        - dynamodb:DescribeTable
        - dynamodb:Query
        - dynamodb:Scan
        - dynamodb:GetItem
        - dynamodb:PutItem
        - dynamodb:UpdateItem
        - dynamodb:DeleteItem

      Resource:
        - 'Fn::ImportValue': ${self:custom.resourcesStage}-ExtNotes2TableArn

functions:
  create:
    handler: create.main
    events:
      - http:
          path: notes2
          method: post
          cors: true
          authorizer: aws_iam

  get:
    handler: get.main
    events:
      - http:
          path: notes2/{id}
          method: get
          cors: true
          authorizer: aws_iam

  list:
    handler: list.main
    events:
      - http:
          path: notes2
          method: get
          cors: true
          authorizer: aws_iam

  update:
    handler: update.main
    events:
      - http:
          path: notes2/{id}
          method: put
          cors: true
          authorizer: aws_iam

  delete:
    handler: delete.main
    events:
      - http:
          path: notes2/{id}
          method: delete
          cors: true
          authorizer: aws_iam

resources:
  - ${file(resources/api-gateway-errors.yml)}
  - ${file(resources/cognito-policy.yml)}
```

---

<div class="post-metadata">

**Author:** ![jayair](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/jayair/32/9_2.png) [@jayair](https://discourse.sst.dev/u/jayair)\
**Post date:** [April 13, 2020, 10:38pm UTC](https://discourse.sst.dev/t/wrapping-up-the-best-practices/1340/3 "2020-04-13T22:38:20Z")

</div>

I think we talked about this. But we needed to remove the included files in the resources section.
