Unexpected charges on your AWS bill
Tags: aws, devops, programming
Published: 2023-03-27 13:36:16

Are you a new AWS user who has experienced bill shock while being in a free-tier plan or a professional cloud practitioner struggling to understand your team’s cloud expenses? If so, you’re not alone. Many AWS users are surprised by unexpected charges on their monthly bills, which can significantly increase the overall cost of using AWS services. As companies’ cloud environments become more complex, lack of visibility can lead to unpredictable cloud bills and budget overruns. In this blog post, we will cover the most common unexpected charges on your AWS bill and provide tips on how to avoid them, so you can optimize your cloud costs and avoid unpleasant surprises.

> _It’s worth mentioning that the list is not exhaustive and covers only the most common ways in which money is wasted on AWS._

## Paying for unused resources

One of the main common unexpected charges is related to idle resources. AWS charges for resources that are not actively used, such as idle EC2 instances, RDS databases, and Elastic Load Balancers. These charges can accumulate over time and result in significant bills. To avoid this, you can use AWS Auto Scaling to automatically adjust the number of resources based on demand. You can also use AWS Reserved Instances or Savings Plans to reduce costs by committing to a one-year or three-year term or use Spot Instances for non-critical jobs or workloads.

Another common source of idle resources is unattached EBS volumes and unused Elastic IPs. To avoid these charges appearing on your bill, create a [policy that automatically deletes any unused EBS volumes](https://aws.amazon.com/blogs/mt/controlling-your-aws-costs-by-deleting-unused-amazon-ebs-volumes/) or EIPs.

## Infrastructure Drift

One major cause of [infrastructure drift](https://www.tailwarden.com/blog/infrastructure-drift-management) is the creation of resources outside of the established IaC tools such as Terraform, CloudFormation, and Pulumi, or without proper approval. When this happens, the infrastructure state is not adequately described or persisted, and the changes made to the infrastructure go unnoticed (aka shadow IT activity).

Until you have total visibility across your environment and have implemented measures to prevent the use of cloud consoles, infrastructure drift is likely to contribute to your AWS bill.

## Data requests, transfers, and retrievals

Another unexpected item that can pop up on your AWS bill is related to data transfer. AWS charges for data transfer within the platform, as well as data transfer to and from the internet. Many users are unaware of this charge and end up with significant increases. To avoid this, you can use AWS services in the same region or availability zone, which is usually free of charge. You can also use AWS Direct Connect for data transfer between your data center and AWS, which can significantly reduce data transfer charges.

## CloudWatch Logs

CloudWatch is the primary source of truth for monitoring the overall health and storing logs of active AWS cloud services. However, it is also notorious for surprise bill spikes due to the complexity of its pricing model.

The pricing is determined by various factors, such as the number of custom metrics, alarms, and dashboards, logs ingested, stored, and analyzed, and the use of contributor insights rules and synthetics canary runs.

The most common way of rapidly driving up costs is by leaving the default retention period. This is especially true for AWS Lambda, which creates an automatic log group with an [indefinite retention setting](https://medium.com/@mlabouardy/how-we-reduced-lambda-functions-costs-by-thousands-of-dollars-8279b0a69931). It’s also important to use alarms and dashboards for key metrics only that way avoiding unnecessary alerts and visualizations.

## AWS Free Tier expired or usage exceeds

AWS is pretty generous with free-tier plans but without proper monitoring, you can exceed the free usage limits in a breeze. The good news is you can monitor usage through the [AWS Management Console](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/tracking-free-tier-usage.html) and track free tier usage. Any usage beyond the free tier limit or after a free trial has ended is charged at standard rates. To avoid charges, set up alerts to notify you before the free tier expires or usage exceeds the limit.

![https://www.reddit.com/r/aws/comments/119admy/300k_bill_after_aws_account_hacked/](https://miro.medium.com/v2/resize:fit:700/0*RiRoTWJe4TpxWtFF.png)

> _AWS Free Tier usage alerts automatically notify you over email when you exceed 85 percent of your Free Tier limit for each service._

## Underutilized Reserved Instances and Savings Plans

When it comes to AWS EC2 costs, there are several recommendations that you can use to save money. One popular approach is to purchase Reserved Instances and Savings Plans. By doing so, companies can potentially save a lot of money on their monthly bills. However, it’s important to note that simply purchasing these plans isn’t enough. In order to fully reap the benefits of Reserved Instances and Savings Plans, you need to make sure that they are being used, monitored, and optimized effectively. Failure to do so can result in unexpected charges and higher costs.

## Dynamic Environments

Elastic Beanstalk is designed to ensure that all necessary resources are running. As a result, it will automatically relaunch any services that you stop. To prevent this, you must terminate your Elastic Beanstalk environment before terminating any resources that Elastic Beanstalk has created.

Similarly, auto-scaling groups are designed to maintain a minimum number of EC2 instances running. Ensure that you terminate your ASG or update the scaling policies to avoid unexpected charges.

## Preventing AWS Bill Shock

AWS has many services to help monitor billing. Setting an account-wide budget alert is a relatively easy first line of defense. Secondly, regularly review and tag your resources to identify any unused or idle resources that you can terminate or downsize to reduce costs. Thirdly, use AWS Cost Explorer to analyze and visualize your costs, identify cost trends, and optimize your spending. Finally, take advantage of AWS tools such as CloudWatch and AWS Config to monitor and optimize your resources continuously.

{% embed https://www.youtube.com/watch?v=OdJeaoZYGOU %}

If you’re looking for an all-in-one platform, you can also leverage open-source tools like [Komiser](https://github.com/tailwarden/komiser) to build your cloud asset inventory, tag resources, set up budget alerts, and [bring accountability to cloud spend](https://www.tailwarden.com/blog/how-to-practice-finops-with-komiser).

## Conclusion

Unexpected charges on AWS bills can put businesses out of the market. However, with the right practices and tools in place, companies can detect and troubleshoot overspending issues before they ever occur.

Whether you’re just starting out with AWS or you’re a seasoned DevOps engineer, [Komiser](https://github.com/tailwarden/komiser) can help you catch potential cost optimization opportunities early, before they become a larger problem.

> Regardless if you are a Developer, DevOps, or Cloud engineer. Dealing with the cloud can be tough at times, especially on your own. If you are using Tailwarden or Komiser and want to share your thoughts doubts and insights with other cloud practitioners feel free to join our [_Tailwarden discord server_](https://discord.tailwarden.com/). Where you will find tips, community calls, and much more.