rurri / serverless-resources-env

Serverlss framework plugin, which after a deploy, fetches cloudformation resource identifiers and sets them on AWS lambdas, and creates local ./.serverless-resources-env/.<region>_<stage>_<function-name> file
MIT License
20 stars 7 forks source link

invoke local doesn't see CF-variables when serverless-webpack plugin is used #10

Open ImmaculatePine opened 6 years ago

ImmaculatePine commented 6 years ago

When serverless-webpack plugin is used getEnvDirectory() function called from different hooks returns different values:

  1. afterDeploy hook -> createCFFile() function. getEnvDirectory() returns this value: /path/to/project/.serverless-resources-env/.us-east-1_dev_functionName This path is used to create envs file.

  2. beforeLocalInvoke hook. getEnvDirectory() returns this value: /path/to/project/.webpack/service/.serverless-resources-env/.us-east-1_dev_functionName This path is used to read envs file but it doesn't exist because envs were written to the different directory on the previous step.

rurri commented 6 years ago

Thanks for the details. Looks like we can work around this by making a special case for webpack to remove the trailing .webpack

ShayHaluba commented 2 years ago

Same with "serverless-esbuild" plugin: