【发布时间】:2021-08-28 06:31:21
【问题描述】:
serverless.yml file
provider:
name: aws
runtime: nodejs12.x
memorySize: 512
stage: ${opt:stage, 'test'}
timeout: 30
##
##...
custom:
getValue: ${file(key.js):randomVal} //pass the string from here
key.js file
module.exports.randomVal = async (context) => {
#code //get the string here
console.log(context.providers);
};
在上面的代码中,我从无服务器 yml 文件中调用 randomVal() 函数,我想从 yml 文件中将字符串传递给该函数。 有什么方法可以实现吗?
【问题讨论】:
标签: javascript yaml amazon-cloudformation serverless-framework