Closed ianzone closed 2 years ago
Hi, my setting is like
useDotenv: true,
provider: { name: 'aws', region: 'us-west-1', runtime: 'nodejs14.x', logRetentionInDays: 7, lambdaHashingVersion: '20201221', environment: { ClientID: '${env.ClientID}', ClientSecret: '${env.ClientSecret}', }, },
When I call console.log(process.env.ClientID, process.env.ClientSecret) in lambda, it literally printed '${env.ClientID} ${env.ClientSecret}'.
Did I use useDotenv wrong? How can I pass values in .env to lambda function when deploying?
oops, just found my typo, it should be environment: { ClientID: "${env:ClientID}", ClientSecret: "${env:ClientSecret}", },
Hi, my setting is like
useDotenv: true,
provider: { name: 'aws', region: 'us-west-1', runtime: 'nodejs14.x', logRetentionInDays: 7, lambdaHashingVersion: '20201221', environment: { ClientID: '${env.ClientID}', ClientSecret: '${env.ClientSecret}', }, },
When I call console.log(process.env.ClientID, process.env.ClientSecret) in lambda, it literally printed '${env.ClientID} ${env.ClientSecret}'.
Did I use useDotenv wrong? How can I pass values in .env to lambda function when deploying?