Interview Prep/AWS/S3, EBS and EFS

A lifecycle rule "expire after 30 days" has been on for months, yet storage is still growing.

IntermediateTroubleshootingS3, EBS and EFS
Answer

Likely causes → The bucket is versioned. Expiring current objects only adds delete markers, so noncurrent versions build up. Other causes: the rule's prefix or tag filter does not match the keys, or the objects are below the minimum size for transitions.

Diagnose →

aws s3api get-bucket-lifecycle-configuration --bucket logs
aws s3api get-bucket-versioning --bucket logs
aws s3api list-object-versions --bucket logs --prefix app/ --max-items 10 \
  --query 'Versions[?IsLatest==`false`].[Key,LastModified]'

Fix → Add NoncurrentVersionExpiration (for example, after 7 days) and ExpiredObjectDeleteMarker: true. Correct the filter prefix.

Prevent → Use S3 Storage Lens to watch noncurrent bytes per bucket, and use one standard lifecycle template for versioned buckets.

aws All AWS questions Roadmap: AWS core services

More on S3, EBS and EFS