# Cannot use multiple $file variable in Resources section of serverless.yml

**URL:** <https://forum.serverless.com/t/cannot-use-multiple-file-variable-in-resources-section-of-serverless-yml/2165>\
**Category:** Serverless Framework\
**Created:** [June 28, 2017, 5:28pm UTC](https://forum.serverless.com/t/cannot-use-multiple-file-variable-in-resources-section-of-serverless-yml/2165 "2017-06-28T17:28:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nclow](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/nclow/32/758_2.png) [@nclow](https://forum.serverless.com/u/nclow)\
**Post date:** [June 28, 2017, 5:28pm UTC](https://forum.serverless.com/t/cannot-use-multiple-file-variable-in-resources-section-of-serverless-yml/2165/1 "2017-06-28T17:28:28Z")

</div>

[This feature request](https://github.com/serverless/serverless/issues/2828) indicates that it should be possible to include multiple files in the Resources section. I want to do this to better manage a large file with hundreds of resources in it.

However, doing this

```
resources:
  Resources:
    - ${{file(1.yaml)}}
    - ${{file(2.yaml)}}

```

Results in a template with the Resources key set to a list, which looks like

```
"Resources": [
    {
      "Resource1": {
        "Type": "AWS::Logs::SubscriptionFilter",
         ...
          
      }
    },
    ...

```

Which fails when the template is uploaded to CloudFormation:

```
  Error --------------------------------------------------
 
  The CloudFormation template is invalid: Template format error: Any Resources member must be an object.

```

What is the proper way to use this feature? I’ve tried this dozens of different ways in multiple versions of serverless and using $file in the Resources section always results in the variable not being interpreted, interpreted wrongly as in this [bug report](https://github.com/serverless/serverless/issues/3511), or producing invalid output in the CF template.

---

<div class="post-metadata">

**Author:** ![rowanu](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/rowanu/32/75_2.png) [@rowanu](https://forum.serverless.com/u/rowanu)\
**Post date:** [July 11, 2017, 10:50pm UTC](https://forum.serverless.com/t/cannot-use-multiple-file-variable-in-resources-section-of-serverless-yml/2165/2 "2017-07-11T22:50:27Z")

</div>

Looking at those bugs reports, I’m not sure this feature works…
