I am trying to create an API to collect all the orders of that day. I am not experienced with amazon aws but I have all the rights I need. I am trying to invoke lambda but the function doesn't exist on the type. How can I get all the orders every day? Is there someone who allready has a working API which I can use?
AWS.config.update({ accessKeyId: '-------', secretAccessKey: '------' });
var lambda = new AWS.Lambda({ region: ENV, apiVersion: '2015-03-31', endpoint: 'https://hbzz6fk5uwetw347zttlwnt7lmmg3i6i0qpytq.lambda-url.' + ENV + '.on.aws', logger: console }); console.log(lambda) var params = { FunctionName: 'function', Payload: JSON.stringify({ 'x': 1, 'y': 2, 'z': 3, }) }; lambda.invoke(params, (err, data) => { if (err) console.log(err, err.stack); // an error occurred else console.log(data); // successful response }); var logs = []; var invokeExists = false; for (var method in lambda) { if (typeof lambda[method] === 'function') { logs.push(`lambda.${method} exists.`); if (method === 'invoke') { invokeExists = true; } } } console.log(logs.join('\n')); console.log(`invoke exists: ${invokeExists}`);