amazon-web-servicesamazon-s3terraformamazon-glacier

How to use regex in the AWS S3 Lifecycle Expiration Prefix Rule


s3 bucket with "folders" 5.10, 5.11, 5.12, 5.13. I would like to create a rule using regex like /*/5.1[1-3]/ to archive folder 5.11, 5.12 and 5.13.

can anyone suggest how can I achieve this using terraform.

Thank you in advance.


Solution

  • Sadly its not possible. S3 lifecycles rules do not support regular expressions.

    You have to explicitly different rules for different prefixes.