Anybody with a bit of experience working with AWS has had that time at the start of the month where you get that shockingly high bill in your inbox.

You head over to the billing dashboard to explore what’s gone on, see a few things you’d expected to be a little higher than usual, but… what’s that? Double digits from CloudWatch? Maybe even triple if you’re working in larger scales? That can’t be right.

Unfortunately it is surprisingly easy to rack up a bill while using CloudWatch if you’re not cautious, but luckily for us it’s just as easy to work on preventing the same thing!

1. Watch that Retention Period

The most important rule to keeping your CloudWatch bill down is keeping only what you need. If you’ve ever ran an application that dumps all of its logs into CloudWatch, you probably went back a month later and realized you’re holding onto gigabytes of logs. It’s annoying to find them and manually clear them out, but luckily there’s a simple solution available: retention periods.

Whether you’re setting up your CloudWatch streams through the AWS console or through IaC tooling, there should be a method to adjust retention times. To do so on the AWS console, go to the list of log groups through the left-side navigation on the CloudWatch dashboard, then click on the value in the “Expire Events After” column for your log group. By default, this will be set to “Never Expire”, so you can see why we want to adjust this!

You’ll then be given a number of options for how long to set your retention rates:

#cloudwatch #billing #aws #costs #elk #reduction #amazon-web-services #amazonwebservices

3 Ways to Avoid that Huge Cloudwatch Bill
1.25 GEEK