- Newest
- Most votes
- Most comments
Hi,
The answer from re:Post Agent is correct. While there may also be an application-level process performing the deletions, I would check the S3 lifecycle policy on your bucket first.
Also, since you already have replication configured, S3 versioning should be enabled on the bucket. This means that if the files were deleted, you should actually be able to see the delete markers in your bucket's version history, which could help determine when the deletions occurred, even without bucket logging--Just go to your S3 bucket and toggle the button that says "Show versions".
This way you should be able to easily track which files were deleted, when they were last deleted/ modified, and retrieve the files without needing to go to the replication target.
Hope that helps.
No, there is no default AWS S3 bucket expiration policy or lifecycle rule that would automatically delete files after seven years or any other specific time period. S3 lifecycle policies are user-defined and must be explicitly configured for each bucket.
Lifecycle policies in S3 are powerful tools that allow you to manage the lifecycle of objects in your buckets, including automatic deletion after a specified time. However, these policies are not applied by default and require manual setup.
The deletion of your seven-year-old files was likely caused by a custom lifecycle rule that was previously set up on your bucket. Without bucket logging enabled, it's difficult to determine exactly what triggered the deletions.
It's worth noting that lifecycle policies, once configured, apply to both existing and new objects in the bucket. So if a policy was set up recently to delete objects older than seven years, it would affect all qualifying objects immediately.
Given that you have replication set up for this bucket, you should indeed be able to restore the deleted files from the replication source. This situation underscores the importance of enabling bucket logging and regularly reviewing your S3 configurations, including any lifecycle policies.
For future reference, you can use AWS Config rules like "s3-lifecycle-policy-check" or "s3-version-lifecycle-policy-check" to monitor and ensure compliance with your intended lifecycle policies across your S3 buckets.
Sources
Bucket policies for Amazon S3 - Amazon Simple Storage Service
s3-lifecycle-policy-check - AWS Config
Edit S3 bucket lifecycle policies - Workload Discovery on AWS
Working with S3 Lifecycle for directory buckets - Amazon Simple Storage Service
Relevant content
asked 2 years ago

Thank you for the additional information. I have been able to search the bucket and see the files that were marked with deletion. There are of course some legitimate deletions, but the majority are the unexpected deletions. There are some files that don't match the date pattern of seven years ago. The deletions happened too fast to suggest it wasn't a manual process. At this stage the plan is to remove the deletion markers on the files we want restored and turn on logging for this bucket. If it happens again we'll have logs to reference.