Ask environment variable

Hi,
my environment variable is getting “[object object]”

my serverless.yml file is
provider:
environment: {file(secrets-{self:provider.stage}.yml)} ==> load from secrets-dev.yml file

and my secrets-dev.yml file is
status:
ERROR: ‘ERR’
INACTIVE: ‘ACT’
OK: ‘OK’

how can i access status.ERROR ?
i try to print process.env.status it return “[object object]”

i try convert it into the json file also same result

any advice ?

thanks

You can’t assign objects to environment variables. From memory the return value is either a string or undefined.

1 Like

thanks @buggy for the help. i manage to put it into another file

1 Like