def create_trigger_from_bucket(self, bucket_name, function_arn):
notification = { "LambdaFunctionConfigurations": [
{ "LambdaFunctionArn": function_arn,
"Events": [ "s3:ObjectCreated:*" ],
"Filter":
{ "Key":
{ "FilterRules": [
{ "Name": "prefix",
"Value": "input/"
}]
}
}
}]
}
try:
self.get_s3().put_bucket_notification_configuration( Bucket=bucket_name,
NotificationConfiguration=notification )
except ClientError as ce:
print ("Error configuring S3 bucket: %s" % ce)
评论列表
文章目录