Interview Prep/AWS/S3, RDS and DynamoDB

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 →

  1. List versions: aws s3api list-object-versions --bucket b --prefix path/
  2. Remove the delete marker: aws s3api delete-object --bucket b --key path/file --version-id <marker-id>
  3. Turn on MFA delete or Object Lock for critical data
  4. Add a bucket policy denying s3:DeleteObjectVersion to most principals
  5. 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.

aws All AWS questions Roadmap: AWS core services

More on S3, RDS and DynamoDB