AWS Pass in variable into buildspec.yml from CodePipeline : <p>I have an AWS CodePipeline that invokes CodeBuild in the Build Stage.</p>

<p>The question is how do I pass in an environment variable from CodePipeline that can be read in the CodeBuild's buildspec.yml?</p>

<p>I know I can set environment variables in CodeBuild, but I want to use the same CodeBuild project for dev, qa, and prod environments.  I don't see how I can pass an environment variable from CodePipeline that makes it all the way to the buildspec.yml</p>

<p>Example buildspec.yml</p>

<pre><code>version: 0.1

phases:   
  build:
    commands:
      - npm install
      - npm build -- --env ${CURRENT_ENVIRONMENT}
</code></pre>

<p>Where CURRENT_ENVIRONMENT would be the variable I set in the CodePipeline Stage action.</p>
