1 Answers
First, my brain looks at your scenario and – despite the fact that it might be a question deliberately contrived to see what you know about S3 event notification – it makes we wonder if the writer understands S3 permissions.
S3 security is probably the number one customer screw-up in AWS. As such, I now have to give mandatory security sermon.
Any object that you PUT into a bucket automatically has default ACLs, and are not publicly accessible. Period. Full stop. No need to check anything. No need to change anything to make it non-public.
"But what if I have a bucket policy that makes things public – either in the entire bucket or only a prefix of that bucket – and I don’t want a new object that I am PUT-ing in that bucket to be public?"
THEN YOU SHOULDN’T HAVE PUT AN OBJECT THAT YOU DON’T WANT PUBLICLY ACCESSIBLE IN A BUCKET THAT MAKES OBJECTS PUBLICLY ACCESSIBLE!!!
Second, (and back to S3 notification) in AWS, where there are many different ways to get something done, the "best option" varies from case to case – which is why we expect architects to know this stuff. Any one of the mechanisms you mentioned above can work. Any of the mechanisms you mentioned above are still ultimately triggered by the S3 event notification subsystem and are subject to the "rare occasions" mentioned in that doc.
If I had to implement that, my questions would be A) is which method will be the easiest to implement, and B) how aggressively do I want to build something to follow up and find any of those "rare occasions".
thanks Steven