在S3事件通知前缀上使用通配符 [英] Using a wildcard on S3 Event Notification prefix

查看:153
本文介绍了在S3事件通知前缀上使用通配符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Lambda函数,可为要上传到我的存储桶的每个图像创建一个缩略图,然后将缩略图放置在另一个存储桶中.上传用户图片(个人资料图片)时,我将用户 ID 名称用作密钥的一部分:

I have a Lambda function that creates a thumbnail image for every image that gets uploaded to my bucket, it then places the Thumbnail inside another bucket. When I upload a user image (profile pic) I use the users ID and name as part of the key:

System-images/users/250/john_doe.jpg

是否可以在prefix路径中使用通配符?这是我到目前为止的内容,但不起作用

Is there a way to use a wildcard in the prefix path? This is what I have so far but it doesn't work

推荐答案

不,您不能-这是字面的前缀.

No, you can't -- it's a literal prefix.

在您的示例中,您可以使用以下两个前缀之一,具体取决于存储桶中的其他内容(如果有些东西共享您不想匹配的通用前缀):

In your example, you could use either of these prefixes, depending on what else is in the bucket (if there are things sharing the common prefix that you don't want to match):

System-images/
System-images/users/

这篇关于在S3事件通知前缀上使用通配符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆