I'm trying to invoke a function as async because I don't wan't to wait the response.
I've read the AWS docs and there says to use InvocationType as Event but it only works if I do a .promise().
not working version:
lambda.invoke({
FunctionName: 'rock-function',
InvocationType: 'Event',
Payload: JSON.stringify({
queryStringParameters: {
id: c.id,
template: c.csvTemplate
}
})
})
working version:
lambda.invoke({
FunctionName: 'rock-function',
InvocationType: 'Event',
Payload: JSON.stringify({
queryStringParameters: {
id: c.id,
template: c.csvTemplate
}
})
}).promise()
Anyone could me explain why it happens?