0
S3Eventによってトリガされるラムダ関数を呼び出そうとしています。私はバケットも作成しましたが、2つのイメージもバケットに追加しました。ラムダ関数の呼び出し中に実行が失敗しました
以下は、バケットの仕様です。以下は
私は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;
}
}
を書かれており、以下、私が
com.amazonaws.services.lambda.runtime.eventsを取得していますエラーでいる私のコードです.S3イベントが表示されない
@oop大丈夫ですが、理由はありますか? – sparrowTrajon
それでは、あなたはその場合にdownvoteしたいですか? – sparrowTrajon
ありがとう、ありがとう:) – sparrowTrajon