1 Answer
- Newest
- Most votes
- Most comments
0
Unfortunately you're going to have to create rules for all folders (or actually prefixes, to use to right term) except the one you want to exclude. Regular expressions can't be used to create a rule like "all prefixes except /foo/bar".
if you can't use tags then another way round this is that if your rule is going to be "apply to everything over X days old" then once a day (or week, or month) run a job to basically do the same as the Linux touch
command and change the last modified date everything in the folder so that it never falls within scope of the rule.
$ aws s3 ls s3://my-practice-bucket/downloads.zip
2023-05-11 11:42:15 105593 downloads.zip
$ aws s3 cp --metadata '{"touched":"now"}' s3://my-practice-bucket/downloads.zip s3://my-practice-bucket/downloads.zip
copy: s3://my-practice-bucket/downloads.zip to s3://my-practice-bucket/downloads.zip
$ aws s3 ls s3://my-practice-bucket/downloads.zip
2023-06-06 13:16:53 105593 downloads.zip
$
(NB I'm not sure if this will work if versioning is enabled on the bucket).
Relevant content
- Accepted Answerasked 2 years ago
- How do I create Amazon Data Lifecycle Manager policies from selected EBS volumes in the EC2 console?AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 7 months ago
- AWS OFFICIALUpdated 8 months ago