Someone deleted objects from a versioned bucket. How do you recover and prevent repeats?
IntermediateScenarioS3, RDS and DynamoDB
Answer
Situation read → With versioning on, a delete adds a delete marker; the data is still there.
What I'd do →
- List versions:
aws s3api list-object-versions --bucket b --prefix path/ - Remove the delete marker:
aws s3api delete-object --bucket b --key path/file --version-id <marker-id> - Turn on MFA delete or Object Lock for critical data
- Add a bucket policy denying
s3:DeleteObjectVersionto most principals - Consider replication to a second account
Why → Deleting the marker restores the previous version instantly.
Interview tip → Without versioning, deletion is permanent; ask whether it was enabled.
More on S3, RDS and DynamoDB
You need to host a static website with HTTPS and low latency worldwide. Which services do you use?BeginnerUploaded files in your bucket must be deleted after 90 days and old versions after 30. How do you do that?BeginnerMillions of small objects are being uploaded and S3 returns 503 Slow Down. What do you do?IntermediateLarge 50 GB files upload slowly from remote offices to S3. How do you speed it up?IntermediateDesign a cross-region DR strategy for a critical S3 bucket with a 15-minute RPO.AdvancedAn analytics team needs query access to 10 TB of logs in S3 without loading a warehouse. What do you propose?Intermediate