Open kraiovsky opened 5 years ago
Looked through the code and it seems to be working as designed.
In my case, though, I run the app both as a server (with Koa + serverless-http) and as a Lambda function. I keep env variables in environment.yml
, generate single .env which is used by both.
So, keeping .env file is important.
I created a pull request to accept an option sls env generate -keepEnvFile
to keep it: https://github.com/DieProduktMacher/serverless-env-generator/pull/12
Thing is, it's kind of going against the purpose of having no unencrypted credentials longer than necessary on your file system. We'll have a look into it and coming back to you as soon as possible.
In my case I need the ability to use secrets in a Lambda@Edge function. Since it doesn't support environment variables, the only way you can really get this to work is to include a .env file with the deployment. I think a -packageEnvFile
option would be really nice to have in this case.
running
first creates and then removes just generated .env. Sample output:
same happens for
sls package
and other commands which seems to be expected according toafter:deploy
hooks, but shouldn't happen for a manual generation?Running
serverless v1.51.0