Open frankTurtle opened 6 years ago
Just ran into this myself. Are there any workarounds?
I am facing the same issue. Getting undefined for environment variables
I know this issue is a bit old, but I'm too facing it, but only for a specific use case. Basically, any environment variable defined in the "provider" can be retrieved properly using "process.env":
But any environment variable defined at a function level cannot.
provider
environment:
FOO: foo <-- I can get it in my tests with process.env
functions:
MyFunction:
environment:
BAR: bar <-- I cannot
For now I duplicate this function's env. variables in a dedicated json file, but being able to not duplicate them (and risk out-of-sync issue) would be great.
I'm having this same issue with cf
variables being not populated on sls version: 1.51.0
.
// variable in serverless.yaml
custom:
DeviceDatabase: ${cf.us-west-1:my-stack.DeviceDatabase}
As this issue is is from 2018 I don't know if this plugin is still in support
provider environment: FOO: foo <-- I can get it in my tests with process.env functions: MyFunction: environment: BAR: bar <-- I cannot
I did some testing and this seems to work as expected with latest version of the plugin and sls v1.58.0. I got both environment variables into the lambda.
I'm having this same issue with
cf
variables being not populated onsls version: 1.51.0
.// variable in serverless.yaml custom: DeviceDatabase: ${cf.us-west-1:my-stack.DeviceDatabase}
I will try to test this scenario. I'm not sure when Cloudformation references are resolved or are they handled actually the Cloudformation deployment.
As this issue is is from 2018 I don't know if this plugin is still in support
We currently don't have a much time to support these plugins, so we appreciate contributions to resolve the issues.