[英]Adding dynamic prefix to S3 bucket
I'm receiving emails in SES where I have a rule to move them to an S3 bucket. 我在SES中收到电子邮件,我有一条规则将它们移至S3存储桶。 I'd like to have dynamically created new prefix every month so I can organize the emails monthly.
我希望每个月动态创建一个新的前缀,以便每月组织一次电子邮件。 For the prefix name I'd like:
<s3-bucket-name>/MM-YYYY/
where MM
being the month and YYYY
the year. 对于前缀名称,我想要:
<s3-bucket-name>/MM-YYYY/
,其中MM
是月份,而YYYY
是年份。
Any idea on how to do this? 关于如何执行此操作的任何想法?
The S3 Action - Amazon Simple Email Service documentation does not appear to offer an option of having a dynamic (changing) prefix. S3操作-Amazon Simple Email Service文档似乎没有提供具有动态(更改)前缀的选项。
You could create an Amazon S3 Event whenever a new object is created in that bucket/path, which can trigger an AWS Lambda function . 每当在该存储桶/路径中创建新对象时,您都可以创建一个Amazon S3事件 ,这可以触发AWS Lambda函数 。 You could then write a function that copies the object to a desired prefix and then deletes the original object.
然后,您可以编写一个函数,将对象复制到所需的前缀,然后删除原始对象。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.