检查以下几点以确定生命周期规则是否正确配置:
以下是一个使用Java SDK注册S3事件监听器的示例代码:
AmazonS3 s3 = new AmazonS3Client();
// Register event listener.
s3.setBucketNotificationConfiguration(
,
new BucketNotificationConfiguration()
.addEventNotification(
S3Event.ObjectCreated,
new S3EventNotification()
.addFilter(
new S3KeyFilter().withFilterRules(
new FilterRule("prefix", )
)
)
.withSnsTopicConfiguration(
new SnsTopicConfiguration()
.withFilterRules(
new FilterRule("suffix", )
)
)
)
);
如果您已经检查了上述项目,并且生命周期规则仍未触发,请联系AWS支持获取帮助。