title: How do I inject environment variables to Lambda running under sam local?
body: <p>I am developing an aws lambda locally using AWS SAM.<br />
  I am trying to inject environment variables, with no success.<br />
  The Lambda code is:</p>
  <pre><code>exports.lambdaHandler = async (event, context) =&gt; {
      console.log('INJECTED ENVIRONMENT:',JSON.stringify(process.env));
      response = {
          'statusCode': 200,
          'body': &quot;booo&quot;
      }
      return response;
  };
  </code></pre>
  <p>The environment file <strong>test.json</strong> is:</p>
  <pre><code>{
    &quot;parameters&quot;: {
      &quot;PPPPPPPPPPPPPPPPPPPPP1&quot;: &quot;PPPPPPPPPPPPPPPPPPPPP1&quot;,
      &quot;PPPPPPPPPPPPPPPPPPPPP2&quot;: &quot;PPPPPPPPPPPPPPPPPPPPP2&quot;,
      &quot;PPPPPPPPPPPPPPPPPPPPP3&quot;: &quot;PPPPPPPPPPPPPPPPPPPPP3&quot;
    }
  }
  </code></pre>
  <p>I am running the lambda. It runs ok, shows me the expected output, Except the env variables I tried defining.<br />
  <strong>sam local invoke -e events/event.json -n test.json</strong></p>
  <p>What am I missing?</p>