J'essaye d'invoquer une fonction lambda qui est déclenchée par S3Event, j'ai créé un seau aussi, ajouté deux images dans le seau.l'exécution a échoué lors de l'appel de la fonction lambda
ci-dessous sont les spécifications de la benne.
Voici mon code que je l'ai écrit en Java
public String handleRequest(S3Event event, Context context) {
context.getLogger().log("Received event: " + event);
// Get the object from the event and show its content type
String bucket = event.getRecords().get(0).getS3().getBucket().getName();
String key = event.getRecords().get(0).getS3().getObject().getKey();
try {
S3Object response = s3.getObject(new GetObjectRequest(bucket, key));
String contentType = response.getObjectMetadata().getContentType();
context.getLogger().log("CONTENT TYPE: " + contentType);
return contentType;
} catch (Exception e) {
e.printStackTrace();
context.getLogger().log(String.format(
"Error getting object %s from bucket %s. Make sure they exist and"
+ " your bucket is in the same region as this function.", bucket, key));
throw e;
}
}
et au-dessous est l'erreur que je reçois
com.amazonaws.services.lambda.runtime.events .S3Evénement absent
@oop ça va, mais est-ce que je peux avoir la raison? – sparrowTrajon
Ok, donc vous voulez downvote dans ce cas? – sparrowTrajon
Ok, merci :) – sparrowTrajon