Referencing variables from other file does not work?


I have env.yml file with

appIconsBucket: dev-portal-icons

and serverless.yml with

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

    - Effect: "Allow"
      - "s3:PutObject"
      - "s3:GetObject"
      - "s3:ReplicateObject"
        - "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: As I write it there, I was able to bypass the problem by direct referencing the variable: {file(./env.yml):S3_BUCKET_ICONS} Thanks.