Can you use wildcards in S3 Lifecycle rule Prefix as a filter when moving objects?

0
  1. I would like to create a Lifecycle Rule using the Prefix filter to move all Folders starting with the word 'FULL' from one storage type to another type and would like to know if this would work: host/sid/FULL or do I need to use a wildcard: host/sid/FULL% or host/sid/FULL*

  2. I have multiple sid folders like these in the same S3 bucket so do I have to create multiple lifecycle rules to do the same or can I do this: host/*/FULL

Note: There are many objects in each FULL* folder and we want all to be moved so that is why we are specifying rule as a folder level. No object tags or key names are created/used.

Thank you

Chez
質問済み 10ヶ月前4375ビュー
2回答
4
承認された回答

No, aesterisk as a wildcard in S3 Lifecycle rule Prefix can't be used.

However I understand your use case, you should consider tag based filtering, where you can apply some common tag to those objects inside those commonly named folders and then create lifecycle rules on basis of tag instead of prefix(leaving prefix blank).

If that's not a feasible workaround, then you would need to create lifecycle rule for each of those prefix.

Hope you find it useful.

profile pictureAWS
エキスパート
回答済み 10ヶ月前
profile pictureAWS
エキスパート
iBehr
レビュー済み 10ヶ月前
  • Thanks for your advise secondabhi_aws

1

I don't think S3 object keys can use wildcards.
This is because the asterisk is not treated as a wildcard, but as a valid special character, as described in the following document.
https://repost.aws/knowledge-center/s3-event-notification-filter-wildcard

So if you want to move things within a specific folder, you will need to create a lifecycle rule for each folder.

profile picture
エキスパート
回答済み 10ヶ月前
  • Thank you Riku for the advise.

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ