300Geeks / aws-elk-billing

Tools for Loading and Visualising AWS Detailed Billing with ELK(Elasticsearch, Logstash, Kibana)
MIT License
157 stars 26 forks source link

Delete all other billing reports except the latest one. #6

Open srajbr opened 8 years ago

srajbr commented 8 years ago

Delete partial AWS Cost and Usage Report billing report at the end of the month. S3 put Event can be used to initiate deletion via Lambda.

sagarkar10 commented 8 years ago

@srajbr can you please elaborate?

droidlabour commented 8 years ago

@sagarkar10 AWS puts new billing files everyday, which makes the previous billing file useless, coz the newly uploaded file contains all the data from that previous file. We need a solution that deletes that previous file whenever a new file is uploaded. Traditional approach will be to use cron and check if a new file is uploaded and delete the previous files. Although AWS provides Lambda functions that can be triggered via an event. So in this case Lambda needs to delete those files and that it will be invoked via S3 PutObject Event.

sagarkar10 commented 8 years ago

@droidlabour so thats cleaning s3 bucket stuff.

droidlabour commented 8 years ago

@sagarkar10 Yeah that's pretty much it.