Exercise

Spring cleaning

Sam's pipeline has been running for a long time now. Since the beginning of 2018, her automated system has been diligently uploading her report to the gid-staging bucket.

In City governments, record retention is a huge issue, and many government officials prefer not to keep records in existence past the mandated retention dates.

People purging records

As time has passed, the City Council asked Sam to clean out old CSV files from previous years that have passed the retention period. 2018 is safe to delete.

Sam has initialized the client and assigned it to the s3 variable. Help her clean out all records for 2018 from S3!

Instructions

100 XP
  • List only objects that start with '2018/final_' in 'gid-staging' bucket.
  • Iterate over the objects, deleting each one.
  • Print the keys of remaining objects in the bucket.