I'm struggling to get any sort of response from ListFunctions that isn't null. I have 3 functions in a single region and have played around with the params and AWS.config.region a fair bit. I'm consistently getting null as a return and in my console logs, I don't get anything back. Any help would be greatly appreciated!
let AWS = require('aws-sdk');
//AWS.config.region = 'ca-central-1';
let lambda = new AWS.Lambda({ "apiVersion": "2015-03-31" });
module.exports.handler = async (event, context) => {
let params = {
//MasterRegion: 'ALL',
//FunctionVersion: 'ALL',
MaxItems: 10
};
lambda.listFunctions(params, function(err,data) {
if(err){
console.log(err);
}
else {
console.log(data);
}
context.done(null, "function finished");
}
}
serverless.yml changes
provider:
name: aws
runtime: nodejs8.10
profile: [PROFILE_NAME]
region: [ca-central-1]
iamRoleStatements:
- Effect: "Allow"
Action:
- "lambda:*"
Resource:
- "*"
undefinedif a function ends without an explicit return value.