question

Use IT B.V. avatar image
Use IT B.V. asked

Amazon AWS lambda invoke. Trying to create an amazon aws api to collect all orders

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}`);
  
                 
nodejsaws
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Levon@Amazon avatar image
Levon@Amazon answered

Hi there,

Thanks for posting! This question is more suited for AWS Forums, please post it there:
https://forums.aws.amazon.com/ - Thanks!

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.