AWS Lambda: Unique Key generator for s3 files
In case of using Lambda for this task you need to save state somewhere. Best fit for your case is DynamoDB. You need to set some sort of counter there and receive value from counter  first. Be careful with concurrency.
I have a AWS lambda function running some code and then saving a json to a s3 bucket.
Currently, my formatting is using the datetime package to grab the current date.
now = str(datetime.today())
I am then formatting the csv to 
'payrollcompensation_streams/{}_{}.json'.format('pega_payrollcompensation_raw',now))
What I want to do is everytime this AWS Lambda function runs generate an unique key of an integer instead of a datetime.
Instead of this: pega_payrollcompensation_raw_2020-03-05 00:00:00.0000
This: pega_payrollcompensation_raw_1
Then the next time
pega_payrollcompensation_raw_2