Optimizing Your AWS Cloud Costs: A Comprehensive Guide

Optimizing Your AWS Cloud Costs: A Comprehensive Guide

How to reduce your AWS Billing.

How to reduce your AWS Billing.

Let's say you are using an AWS account for the practice purpose , then you want to be extra careful while learning or paying with the AWS Resources.

So we will elaborate some of the steps to reduce our AWS Billing. We will learn how to check AWS resources running in different regions with the AWS Cloud account.

When we are learning with the AWS resources post-practice we should delete the resources which have been created during the practice, otherwise AWS keep charging for your particular resources. After a month or a week we will get notification from the AWS as well.

Let's start over here.

So in the AWS console go to the AWS Billing and Cost Management.

So as I have done one of the projects about the VPC with the Public and Private environment due to that my billing is a little bit high though I have forgotten to delete the resources post practice.

So once we click on that value like $27.45 it shows the graph and does not clearly explain.

We are not able to understand which service or resources are actually charging to us.

In this scenario where we had created the services through the UI and forgot that which services has been created by us then there is once service in Console “ Tag Editor”

Then go to the Resource Group and Tag Editor Service.

Click on Create resource group.

Then Click on Tag Editor @ Left Pane.

Select the Regions: All Regions &

Resource Type should be “All supported resource types”

Post that just click on Search Resources.

The list of all the resources which I had created showing below:

As I said earlier I have done the project VPC with the Public and Private environment where I had created the multiple resources to understand VPC and its components.

AWS does not charge for every resource, Lets say default VPC has not been chargeables, but when we have things like NAT Gateways, Internet Gateways & Bastion Hosts that are chargeable.

From my list Lets say I have to delete Internet Gateway then I have to click on that particular resource. Of Course there are some dependencies issues that would be there while deleting the resources.

So we will take another example for the ACL, Click on acl.

And go in the actions and delete the ACL.

The best practice is always to create the resources in the one region only instead of creating the resources in multiple regions. If we create the resources in multiple regions then that would be confusing to manage.

Another method is instead of using UI (AWS Console) to manage resources we will use CLI as well.

To use the CLI we need security credentials and will create the access token for the IAM Account.

Click on Create access key.

Then go to our terminal & type the command “aws configure”

We can use below command

Also if we want to take this output into in the json file as well with the following command:

If we want to check the resources in the multiple regions then we can user the for loop.

Another way to reduce the AWS billing is then go to the AWS bill

So if we want to restrict the cloud cost with the particular figure use the Budgets in the AWS Billing Services.

On the left pane we can see the Budgets.

Click on the Budgets:
Then Create a Budget.

There we are able to create a Monthly Budget.

Above we can put 20$ monthly. Then we have to put an email id as well.

If the Budget would exceeds 20$ that we will get an email notification on the email address. So here AWS does not send an email only 20$ would be exceeded. But it actually sends you three times. As per above mentioned.

Then click on create the Budget and it will be created.

If we want to understand the reports we can also create a report for your budget. It is very best practice if we are working in an organization where we can share the monthly reports to the management.

How can we improve these practices?

The very first thing that we have to do is try to reduce UI (AWS Console Access) access. Whoever is having access lets say development team having an access so being an admin or DevOps engineer do not provide an UI access to them always go for the Iac. (terraform or CloudFormation )

Why Terraform?

Let's say if we can create a resource through UI then we have to manually delete those resources. Also there are dependencies while deleting the resources. There might be chances to forget to delete the resources due to dependencies as well and extra cost would be chargeable. But if you have terraform so with a single command like terraform destroy would delete the resources and dependencies also taken care of by terraform itself. In short with the CFT & terraform our cloud billing significantly reduced.

Another one is Least Privileges? This means only providing limited access .

Final thing we have to highlight over here: Cost optimization. 

With the Cost Optimization we can save at least 50% of what they are running today.

In most organizations people created stale resources like EBS volumes and a bunch of the EC2 instances & not being used for a long time.

We will do an in depth video on Cost optimization.

Thank You!!

Happy Learning!!