Interview Prep/AWS/S3, RDS and DynamoDB

Uploaded files in your bucket must be deleted after 90 days and old versions after 30. How do you do that?

BeginnerScenarioS3, RDS and DynamoDB
Answer

Situation read → S3 lifecycle rules.

What I'd do →

  1. Enable versioning
  2. Add a rule: expire current objects after 90 days, NoncurrentVersionExpiration 30 days, and abort incomplete multipart uploads after 7 days
  3. Apply: aws s3api put-bucket-lifecycle-configuration --bucket app-uploads --lifecycle-configuration file://lifecycle.json
  4. Verify with get-bucket-lifecycle-configuration

Why → Lifecycle is free automation that stops storage costs creeping up.

Interview tip → Mention incomplete multipart uploads as hidden cost.

aws All AWS questions Roadmap: AWS core services

More on S3, RDS and DynamoDB