S3 event handling in Lambda can be done, but you should keep in mind that the S3Event object carries a reference to the object, not the object itself. To get to the actual facility, you must use the AWS SDK yourself. A request to an S3 object in a lambda function will look like this:
public Object handleRequest(S3Event input, Context context) { AmazonS3Client s3Client = new AmazonS3Client(new DefaultAWSCredentialsProviderChain()); for (S3EventNotificationRecord record : input.getRecords()) { String s3Key = record.getS3().getObject().getKey(); String s3Bucket = record.getS3().getBucket().getName(); context.getLogger().log("found id: " + s3Bucket+" "+s3Key);
Now the pretty tricky part is to insert this object into ElasticSearch. Unfortunately, the AWS SDK does not provide any features for this. The default approach would be to call REST against the AWS ES endpoint. There are various examples of them on how to continue calling an ElasticSearch instance.
Some people seem to come with the following project:
Jest - Elasticearch Java Rest Client
source share