I am trying to setup a lifecycle rule to clean up my bloated athena OutputLocation folder and I need some clarification
Snippets of lifecycle rule currently setup below
Will this rule only apply to the folder athena-results/ in my bucket?
The rule actions are a little unclear to me, in terms of what to actually select? I want to delete any and all existing files in this location older than 1 day - files going back a few years as well as daily going forward. Is my current selection correct? Expire current version of objects, I assume this one takes care of all the historical files? Or do I also need to select the 5th option, Delete expired delete markers or incomplete multipart uploads?
For further context and what this OutputLocation folder is used for:
$query = $client->startQueryExecution([ "QueryString" => $sql, "ResultConfiguration" => [ "OutputLocation" => "s3://s3location/athena-results" ] ]);
$obj = $s3->getObject([ 'Bucket' => 'analytics', 'Key' => 'athena-results/'.$queryId.'.csv' ]);