We have multiple buckets that are used by our clients. A client uploads a single file (random filename) to their bucket, and we then visit that bucket and copy it to our own bucket for processing. Basically, this: https://stackoverflow.com/a/10418427/2868238
How could I automate this? I note lambda has s3 object event support so wonder if I can use this somehow?
Paul.
This use case is almost the textbook example for AWS Lambda. If you look at the AWS Lambda image resize example, all you need to do is remove code that tests for the image type and actually does the resize- it's designed to download, transform, then upload the object to a new S3 bucket.
Also, you may be able to do this even more easily (and cheaply) with S3 cross-region replication, but that requires the buckets be in different regions (thanks @William-Gaul).
So, it depends on your precise use case.
This should help you out , it is written in detail on how to do replication between two buckets based on events. http://docs.aws.amazon.com/lambda/latest/dg/with-s3-example-prepare.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With