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);
};
In the above code, I am calling randomVal() function from the serverless yml file, I want to pass a string to that function from yml file. Is there any way to achieve it?