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
When serverless-webpack plugin is used getEnvDirectory() function called from different hooks returns different values:
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.
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.
When
serverless-webpack
plugin is usedgetEnvDirectory()
function called from different hooks returns different values: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.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.