title: AWS CodeBuild secrets-manager config with environment variable
body: <p><strong>Update:</strong></p>
  <p>Not sure when this happened, but this works as is described now.</p>
  <p>As well as an option in the Pipeline build action to set the secret directly.</p>
  <p><a href="https://i.stack.imgur.com/VOc3s.png" rel="noreferrer"><img src="https://i.stack.imgur.com/VOc3s.png" alt="secrets-manager" /></a></p>
  <hr />
  <p><strong>Original Question:</strong></p>
  <p>I have an environment variable set for the <code>secret-id</code> set inside the build phase of a AWS CodePipeline. eg. <code>$SECRET_ID</code>.</p>
  <p>I want to use it in the CodeBuild buildspec.yml to get a set of secrets from the Secrets Manager based on my environment. Is it possible to self-reference other variables in a buildspec file?</p>
  <p>This is how I would have anticipated it would work, but it doesn't.</p>
  <pre class="lang-yaml prettyprint-override"><code>version: 0.2
  
  env:
    secrets-manager:
      MY_SECRET: ${SECRET_ID}
  
  phases:
    build:
      commands:
        - echo $MY_SECRET
  </code></pre>
  <p>I receive the following error in the build logs.</p>
  <p><code>Secrets Manager Error Message: ValidationException: Invalid name. Must be a valid name containing alphanumeric characters, or any of the following: -/_+=.@!</code></p>