scar.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:scar 作者: grycap 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号