I have a golang lambda function and it needs an environment variable to function and when running the function via invoke local
it’s failing to receive the environment variables I set.
I’m invoking the function with the following command:
serverless invoke local \
--function oauth \
--data '{ "queryStringParameters": {"code":"<Example>"}}' \
--env OAUTH_CLIENT_ID=${OAUTH_CLIENT_ID} \
--env OAUTH_CLIENT_SECRET=${OAUTH_CLIENT_SECRET}
But my function is simply not getting the environment variables. The logs from serverless are displaying the correct values, so I’m guessing I’m doing something wrong or the runtime isn’t receiving the values.
I do have these environment variables to be configured from ssm in my serverless.yml file:
environment:
OAUTH_CLIENT_ID: ${ssm:oauthClientID}
OAUTH_CLIENT_SECRET: ${ssm:oauthClientSecret}
Any ideas?
I’m using serverless 1.40.0