I have search about this issue and couldn't find anything that would help me.
EDITED
The main idea is to, each time the lambda function is triggered by cloudwatch (everyday), choose a subsequent line from the text file that I get from a s3 bucket, that line will be attached to an e-mail.
The next time the lambda is triggered, the same will happen, but with the next line in the text file, and so on.
I have more or less an idea, using a for loop, my problem is how to, each time the function is triggered, select the next line in the text file.
If you need to read lines from your file in sequence, one lambda execution a day is one line, then you have to keep track of those lines. If its only once a day, you could use SSM Parameter Store for that. Each time your lambda executes, it would query SSM Parameter Store the the line number which was read previously.
Similarly, after successful dispatch of a line, the Lambda function would update the parameter in SSM Parameter Store.
The exact details depend on how big the file is, as this process can get progressively slow with time.
Send line from file each time Lambda function is triggered [python]