title: Serverless - How to access Aws secret manager as environment variable
body: <p>Currently, I am accessing AWS parameter store value as environment variable. It is defined in serverless yml like so:</p>
  
  <pre><code>environment:
      XYZ_CREDS: ${ssm:xyzCreds}
  </code></pre>
  
  <p>In code, I access this like so <code>process.env.XYZ_CREDS</code><br>
  I need to move this value to AWS secret manager and access the xyzCreds in the same way.<br>
  Based on the <a href="https://serverless.com/framework/docs/providers/aws/guide/variables/#reference-variables-using-aws-secrets-manager" rel="nofollow noreferrer">serverless document</a> I tried like so -  </p>
  
  <pre><code>  custom:
      xyzsecret: ${ssm:/aws/reference/secretsmanager/XYZ_CREDS_SECRET_MANAGERa~true} 
    environment:
      XYZ_CREDS: ${self:custom.xyzsecret}}
  </code></pre>
  
  <p>But it's not working. Please help!</p>