Referencing variables from other file does not work?

Hi,

I have env.yml file with

appIconsBucket: dev-portal-icons

and serverless.yml with

env: ${file(./env.yml)}

provider:
  ...
  iamRoleStatements:
    - Effect: "Allow"
      Action:
      - "s3:PutObject"
      - "s3:GetObject"
      - "s3:ReplicateObject"
      Resource:
        - "arn:aws:s3:::${self:env.appIconsBucket}/*"

And sls command outputs this error: Trying to populate non string value into a string for variable ${self:env.appIconsBucket}. Please make sure the value of the property is a string.

But I don’t understand what’s wrong, could anyone point me to the problem? I use 1.0.0-rc1

Hm, it looks like the env key is one problem. When I rename it to custom and include all variables directly to the serverless.yml, it works. But when I reference them (using custom: ${file(./env.yml)}), it shows the error again.

@JakubMatejka could you add that as an issue in our github with a config that fails. This looks like a bug.

I created the issue: https://github.com/serverless/serverless/issues/2169. As I write it there, I was able to bypass the problem by direct referencing the variable: {file(./env.yml):S3_BUCKET_ICONS} Thanks.