Multiple resource imports

Hello, I’m trying figure out how to reference multiple yml files under resources. I have multiple services in a single project and would like to isolate the IAM/triggers configuration.

resources:
  Resources:
    $ref: file1.yml
    $ref: file2.yml

gives the YAML exception ‘duplicated mapping key’ and making it an array of $ref doesn’t work either.

I’ve searched for JSON ref syntax but haven’t found anything useful. Any advice?

Hi mikkelspring, this is sadly not possible. We are introducing a different way to configure your system though that will allow this: https://github.com/serverless/serverless/pull/1834

Cool, thanks…looks like serverless is on the cusp of a lot of wonderful things

This is also what I would like to do, as our Resources section is now getting pretty big. I’d like to be able to split up into different files, for instance:

Resources:
 ${file(./databases.yml)
 ${file(./alarms.yml)
 ${file(./vpc.yml)

etc