Skip to content
This repository has been archived by the owner on Sep 30, 2019. It is now read-only.

yml file inclusion #79

Open
SET001 opened this issue Feb 12, 2019 · 6 comments
Open

yml file inclusion #79

SET001 opened this issue Feb 12, 2019 · 6 comments

Comments

@SET001
Copy link
Contributor

SET001 commented Feb 12, 2019

does emulator currently understand following syntax in serverless.yml?

environment: ${file(config/${self:provider.stage}.yml)}

I use it to sepparate configuration for different stages and it work on AWS but does not in emulator

@lightsofapollo
Copy link
Contributor

Good question! It should given we use serverless directly to parse the config but if it's not working for you then clearly we need to fix something. Does using an absolute path work? What is the error?

@SET001
Copy link
Contributor Author

SET001 commented Feb 12, 2019

I use file inclusion to include environment variables and then use in from my lambdas. In lambda they available under process.env but when I use it with emulator all they are undefined so I suppose that file inclusion format may be not supported by emulator or I'm missing something...

Does using an absolute path work?

the same in this case:

environment: ${file(env.yml):${self:provider.stage}}`

and in case with absolutely absolute path. The only content of process.env is

{ DYNAMODB_ENDPOINT: 'http://localhost:62224/' }

@SET001
Copy link
Contributor Author

SET001 commented Feb 12, 2019

as far as I see now, the problem is not in yml file inclusion, but it is in not passing values from provider.environment to lambda's process.env.

@lightsofapollo
Copy link
Contributor

@cbaron Let's re-evaluate passing env to lambda. Seems like it's useful.

@SET001
Copy link
Contributor Author

SET001 commented Feb 18, 2019

any updates on this? do you plan to implement this?

@cbaron
Copy link
Contributor

cbaron commented Feb 18, 2019

I will try to carve out some time this week. As always, you're welcome to put up a PR.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants