"Auckland": S3 delete & archive old backups
Scenario: "Auckland": S3 delete & archive old backups
Level: Medium
Type: Do
Access: Email
Description: Ops left years of database dumps in s3://auckland-backups. Keys use an absolute date prefix:
backups/YYYY-MM-DD/...
Apply this retention policy (use the date in the key, ignore LastModified):
- Before 2023-01-01 — delete those objects
- From 2023-01-01 through 2024-12-31 — keep them but set storage class to GLACIER
- On or after 2025-01-01 — leave as Standard
- Keys without that date prefix — leave untouched
aws s3 ls s3://auckland-backups --recursive
NOTE: this scenario uses Floci, a local AWS emulator; there are no real AWS resources.
Root (sudo) Access: True
Test: In s3://auckland-backups: objects with key date < 2023-01-01 are gone; dates 2023-01-01.. 2024-12-31 are GLACIER (or deep archive); dates ≥ 2025-01-01 and non-dated keys remain Standard.
The "Check My Solution" button runs the script /home/admin/agent/check.sh, which you can see and execute.
Time to Solve: 20 minutes.