Split-Up / Include / Reference serverless.yml file?


Just some short question regarding larger projects:

  • Is it possible to split up the serverless.yml file into several files?
  • Or to “include” other yml files in the main serverless.yml file?
  • Or to reference to other serverless.yml files in subfolders?


The best way to structure a large project is with an API per functionality.


You will end up getting long deploy times if you do not structure in this way and you will end up hitting a hard limit of 200 resources per Cloudformation template.

Good luck


@Franky you can reference smaller yaml files with the ${file} variables https://serverless.com/framework/docs/providers/aws/guide/variables/#reference-variables-in-other-files


@DavidWells thanks for the hint, i did overlook this little detail in the docs.