I'm currently uploading a file into AWS S3 Bucket(B1) with 250 MB size & 1 Million records. This triggers a Lambda (L1 - 1.5GB, 3 Mins) which reads this file & grouping the records with some criteria & writing about 25K files into S3 again on the different bucket(B2).
Now, notification event configured on Bucket (B2) generates 25K events(requests) to different Lambda (L2 - 512MB, 2Mins, Concurrency-2). This Lambda calls a Java-based micro-service which makes an entry into DB after processing which takes about 1-2 seconds for each call.
The problem here is, Once 2nd Lambda (L2) is triggered, there's no way to stop it. It runs for hours & not receiving any other event for the same lambda until processing all events completely & I've no control over S3 events triggered already.
Can someone please explain how events triggered on S3 upon file upload being processed (architecture) on Amazon S3 & how to get fine-grained control over S3 events triggered?
Is there anything I can do on AWS Lambda side to stop S3 events triggered already?