AWS cost reduction with aws-nuke

In most organizations, a common pattern of using AWS is to have multiple accounts for production, staging, and development. In such a setup, it is inevitable to lose track of various experimental AWS resources instantiated by your developers. Eventually, you are **billed **for these resources; even though this could have been avoided if you were proactively identifying and deleting all such resources.

So, how should you identify and delete such unnecessary resources?

aws-nuke_ to the rescue._

Image for post

aws-nuke to the rescue

aws-nuke is a tool that removes all resources from an AWS account.

Our organization recently created an internal Jenkins wizard on top of aws-nuke to help developers clean up their AWS accounts. This identified and deleted long-forgotten resources that were instantiated years back for various POCs.

aws-nuke README page does a great job of explaining how to use the tool, and therefore we won’t reinvent the wheel. Rather, I am sharing some of the issues we faced and our learnings from using this tool for over two months now.


1. Create an org-wide standard nuke config that allows customization!

aws-nuke uses a YAML configuration file to target and filter resources. Given how destructive this tool is, no developer in their sane mind would like to play with it on their own. Therefore, you must develop a standard configuration for your entire organization.

I can not emphasize enough on the importance of this step. Run, analyze, and verify your standard configuration a thousand times (and a thousand times more) before making it available to your developers.

There will always be a genuine requirement from some developers to save their resources deleted by your standard configuration. Provide a way for them to override the standard configuration.

2. Provide a dry-run option

aws-nuke’s default mode is non-destructive which only prints all the AWS resources that will be deleted when you run the tool in -no-dry-run mode. Your developers need to be able to use this default mode to save some of their resources from deletion if required.

While optional, you might want to parse and format the report which is generated by aws-nuke to make it more readable.

3. AWS credentials to authenticate aws-nuke

This will depend on how your organization set up AWS. After juggling through various approaches, we finally settled down with this approach of using static credentials:

  • For each run of the tool, create a new temporary IAM user in the account which is being nuked.
  • Provide root access to this temp-IAM-user.
  • Ensure your nuke config filters this temp-IAM-user from deletion.
  • Generate accessKeyId and secretAccessKey for this temp-IAM-user.
  • Pass these static credentials to the aws-nuke tool.
  • Delete this temp-IAM-user user after aws-nuke run finishes.

#aws #cost-reduction #devops

What is GEEK

Buddha Community

AWS cost reduction with aws-nuke
Seamus  Quitzon

Seamus Quitzon

1601341562

AWS Cost Allocation Tags and Cost Reduction

Bob had just arrived in the office for his first day of work as the newly hired chief technical officer when he was called into a conference room by the president, Martha, who immediately introduced him to the head of accounting, Amanda. They exchanged pleasantries, and then Martha got right down to business:

“Bob, we have several teams here developing software applications on Amazon and our bill is very high. We think it’s unnecessarily high, and we’d like you to look into it and bring it under control.”

Martha placed a screenshot of the Amazon Web Services (AWS) billing report on the table and pointed to it.

“This is a problem for us: We don’t know what we’re spending this money on, and we need to see more detail.”

Amanda chimed in, “Bob, look, we have financial dimensions that we use for reporting purposes, and I can provide you with some guidance regarding some information we’d really like to see such that the reports that are ultimately produced mirror these dimensions — if you can do this, it would really help us internally.”

“Bob, we can’t stress how important this is right now. These projects are becoming very expensive for our business,” Martha reiterated.

“How many projects do we have?” Bob inquired.

“We have four projects in total: two in the aviation division and two in the energy division. If it matters, the aviation division has 75 developers and the energy division has 25 developers,” the CEO responded.

Bob understood the problem and responded, “I’ll see what I can do and have some ideas. I might not be able to give you retrospective insight, but going forward, we should be able to get a better idea of what’s going on and start to bring the cost down.”

The meeting ended with Bob heading to find his desk. Cost allocation tags should help us, he thought to himself as he looked for someone who might know where his office is.

#aws #aws cloud #node js #cost optimization #aws cli #well architected framework #aws cost report #cost control #aws cost #aws tags

Ron  Cartwright

Ron Cartwright

1600596000

Improve Your Cost Management with AWS Saving Plans

The adaptability and flexibility of today’s cloud services present a lot of opportunities to cut infrastructure costs. Amazon Web Services and its plethora of services let you set up any kind of cloud environment for any type of application, without forcing you to make long-term commitments. At the very least, you don’t have to make a big initial investment to set up your cloud environments.

AWS resources are designed to make deploying cloud-native applications easy and affordable. Affordability is always important for businesses because cost-efficient applications guarantee higher returns on cloud investment. The way AWS services are set up allows for easy scaling of apps and cloud resource usage, but keeping your cloud environment efficient is not without its challenges.

#aws #amazon web services #cost #cost optimization #cost analysis #cost management #cost analytics #aws costs

Rory  West

Rory West

1620896820

7 Challenges With AWS Costs

This article is the first of our series on AWS cost optimization. In this series, we’ll introduce the challenges with AWS costs. We’ll also offer actionable recommendations on how to solve them and perform efficient AWS cost optimization.

Most businesses spend much more on processing and storage than they need. This is often the case with operating expenses for excess capacity to meet peak demand in their on-site data centers.

Moving to public cloud services such as AWS helps enterprises to maximize the consumption levels of their workloads. At the same time, they reduce their total costs. There are major benefits of substituting conventional up-front hardware purchases for the more effective pay-as-you-go scheme.

The large scale on which AWS works also helps its consumers to continuously reduce the computing and storage facilities costs with economies of scale. AWS has the ability to change the model of running technology and platform services dramatically. However, companies have to use it wisely.

#aws cost management #aws cost optimization #aws costs #challenges with aws costs #aws

Rory  West

Rory West

1619168520

9 KPIs for Measuring Success with AWS Savings

Gathering and reviewing data to obtain useful insights into your organization and assess the performance of your processes is essential. When it comes to AWS savings, it’s necessary to calculate your AWS expense and utilization performance metrics. You should do this just like you measure your operational activities. As 35% of the cloud spend is wasted, organizations need to find more effective ways to make the most out of their AWS savings.

In the previous articles of this series, we discussed the most common challenges with AWS costs, listed three reasons why organizations need AWS cost optimization, and made a short introduction to FinOps. In this article, we suggest some cost management metrics that can help you track AWS savings more effectively. Moreover, you can use them as a tool to predict future performance and make cutting decisions.

#aws cost optimization #aws cost management #aws costs #aws savings #aws

9 KPIs for Measuring Success with AWS Savings

Gathering and reviewing data to obtain useful insights into your organization and assess the performance of your processes is essential. When it comes to AWS savings, it’s necessary to calculate your AWS expense and utilization performance metrics. You should do this just like you measure your operational activities. As 35% of the cloud spend is wasted, organizations need to find more effective ways to make the most out of their AWS savings.

In the previous articles of this series, we discussed the most common challenges with AWS costs, listed three reasons why organizations need AWS cost optimization, and made a short introduction to FinOps. In this article, we suggest some cost management metrics that can help you track AWS savings more effectively. Moreover, you can use them as a tool to predict future performance and make cutting decisions.

#aws cost optimization #aws cost management #aws costs #aws savings #aws