Fixed by @williamtsoi1 at: https://gist.github.com/williamtsoi1/104531c65852a852399a3dc1096a2dcc
Thanks for this code. This was very useful for me as I needed something to do this.
However, I think there's a bug in here, because running the code as-is causes an infinite loop. Each time the file gets overwritten by the lambda, another instance of the lambda gets invoked due to the S3 ObjectCreated (All) event, and this repeats itself ad-infinitum.
Here's my version of the solution, which does a check on the ownership of the S3 object against the running AWS account before deciding on whether to go through with the s3.CopyObject() operation or not.
Thanks once again!