I have a lambda which does multiple things in parallel (I call async functions and just wait for their Promise.all to be fulfilled before moving on).
The problem: as soon as one of these tasks fails and the async function throws, I want to be able to terminate the lambda and interrupt everything. Something like calling exit(-1). Is there any way to do this?
I don't want to report a failure then have cloudformation do a ROLLBACK (therefore calling my lambda with the event Delete), start deleting/rollbacking stuff and maybe the other async functions were still doing their Create event therefore making a terrible mess. I looked at the CloudWatch logs and it seems that this mess is a totally plausible scenario.
 
     
    