title: Set environment variables from external file in serverless.yml
body: <p>I'm using serverless and serverless-local for local development.</p>
  
  <p>I've got an external file which holds references to environment variables which I retrieve from <code>node.env</code> in my app.</p>
  
  <p>From what I understand, I should be able to set my environment variables such as</p>
  
  <pre><code>dev:
     AWS_KEY: 'key',
     SECRET: 'secret
  test:
     AWS_KEY: 'test-key',
     SECRET: 'test-secret',
  etc:
     ...
  </code></pre>
  
  <p>and have those environment variables included in my app through the following line in my serverless.yml</p>
  
  <pre><code>provider:
    name: aws
    runtime: nodejs4.3
    stage: ${opt:stage, self:custom.default_stage}
    deploymentBucket: serverless-deploy-packages/${opt:stage, self:custom.default_stage}
    environment: 
      ${file(./serverless-env.yml):${opt:stage, self:custom.default_stage}}
  </code></pre>
  
  <p>then in the commandline, I call</p>
  
  <p><code>serverless offline --stage dev --port 9000</code></p>
  
  <p>I thought this would include the correct vars in my app, but it isn't working. Is this not how it is supposed to work? Am I doing something wrong here?</p>