<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[KloudWiz]]></title><description><![CDATA[We will talk about Cloud / DevOps / SRE Practices / Automation, and Tools here ...]]></description><link>https://blog.kloudwiz.com</link><generator>RSS for Node</generator><lastBuildDate>Wed, 10 Jun 2026 00:26:15 GMT</lastBuildDate><atom:link href="https://blog.kloudwiz.com/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[AWS Nuke ☢️💥 - How to use it?]]></title><description><![CDATA[In the earlier blog, we saw what AWS Nuke is and why & when you should use it.
In this blog, we'll walk through how to install and use aws-nuke to keep your AWS accounts tidy.
🔍 Finding the Right Version of AWS-Nuke
aws-nuke is a command-line tool t...]]></description><link>https://blog.kloudwiz.com/aws-nuke-how-to-use-it</link><guid isPermaLink="true">https://blog.kloudwiz.com/aws-nuke-how-to-use-it</guid><category><![CDATA[AWS]]></category><category><![CDATA[cost-optimisation]]></category><category><![CDATA[Security]]></category><category><![CDATA[Devops]]></category><category><![CDATA[SRE]]></category><category><![CDATA[Platform Engineering ]]></category><category><![CDATA[#IaC]]></category><category><![CDATA[infrastructure]]></category><category><![CDATA[resource management]]></category><dc:creator><![CDATA[Ishwar Galane]]></dc:creator><pubDate>Sun, 20 Oct 2024 09:32:42 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1729416219024/72421690-aeb2-45fc-b932-b04f6bc4bf8f.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In the earlier <a target="_blank" href="https://blog.kloudwiz.com/aws-nuke-what-why-and-when">blog</a>, we saw what AWS Nuke is and why &amp; when you should use it.</p>
<p>In this blog, we'll walk through how to install and use <code>aws-nuke</code> to keep your AWS accounts tidy.</p>
<h2 id="heading-finding-the-right-version-of-aws-nuke">🔍 Finding the Right Version of AWS-Nuke</h2>
<p><code>aws-nuke</code> is a command-line tool that helps you automatically delete AWS resources. It's perfect for cleaning up development, staging environments, or handling multiple AWS accounts. 💼</p>
<p>But wait—there are <strong>two versions</strong> of <code>aws-nuke</code> you’ll likely come across:</p>
<ol>
<li><p>The original version by <a target="_blank" href="https://github.com/rebuy-de/aws-nuke"><strong>rebuy-de</strong></a>, which is now <strong>deprecated</strong> (⛔).</p>
</li>
<li><p>The actively maintained version by <a target="_blank" href="https://github.com/ekristen/aws-nuke"><strong>ekristen</strong></a>, which is the one we'll be using in this guide (✅). You can check it out <a target="_blank" href="https://github.com/ekristen/aws-nuke">here</a>.</p>
</li>
</ol>
<p>We’ll focus on the latest version, which is free to use under the MIT license, and the documentation can be found <a target="_blank" href="https://ekristen.github.io/aws-nuke/">here</a>.</p>
<h2 id="heading-installing-aws-nuke">🔧 Installing AWS-Nuke</h2>
<p>There are two main ways to install <code>aws-nuke</code>. Let’s dive in! 🌊</p>
<p><strong>Option 1: Install from Released Binaries</strong></p>
<p><strong>The recommended way is to grab the released binaries from GitHub.</strong></p>
<ol>
<li><p>Head over to the <a target="_blank" href="https://github.com/ekristen/aws-nuke/releases">GitHub releases page</a>.</p>
</li>
<li><p>Download the binary for your OS (Linux, macOS, or Windows).</p>
</li>
<li><p>Add the binary to your <code>$PATH</code>, so you can run it from anywhere.</p>
</li>
</ol>
<p><strong>Option 2: Install via Homebrew (Mac Users 🍎)</strong></p>
<p>If you’re on a Mac, Homebrew makes this super easy. Just run:</p>
<pre><code class="lang-bash">brew install ekristen/tap/aws-nuke
</code></pre>
<p>⚠️ <strong>Heads up!</strong> Make sure you use the correct tap (<code>ekristen/tap/aws-nuke</code>). If you accidentally install with just <code>brew install aws-nuke</code>, you might end up with the older, deprecated version.</p>
<h2 id="heading-getting-started-with-aws-nuke">🚀 Getting Started with AWS-Nuke</h2>
<p>Alright, you’ve got it installed—now let’s use it! 😎</p>
<h3 id="heading-step-1-aws-credentials">Step 1: AWS Credentials 🔑</h3>
<p>Before running anything, make sure your AWS credentials are set up properly. You can configure these either through environment variables or the <code>~/.aws/credentials</code> file. You will need ‘Administrator’ permission on the account where you want to run the clean-up.</p>
<h3 id="heading-step-2-create-a-config-file">Step 2: Create a Config File 🛠️</h3>
<p>Next, create a configuration file (typically named <code>config.yml</code>) to specify which AWS accounts and regions you want to clean up, and any specific resources you want to keep.</p>
<p>Here’s a simple example:</p>
<pre><code class="lang-bash">regions:     <span class="hljs-comment"># Specify the regions to target for clean-up.</span>
  - <span class="hljs-string">"global"</span> <span class="hljs-comment"># This is for all global resource types e.g. IAM</span>
  - <span class="hljs-string">"us-east-1"</span>
  - <span class="hljs-string">"us-west-2"</span>

blocklist:   <span class="hljs-comment"># Specify which accounts should not be touched (Stage/Prod etc.)</span>
  - <span class="hljs-string">"111122223333"</span> <span class="hljs-comment"># Keep this account safe from nuking</span>

accounts:    <span class="hljs-comment"># Specify which accounts to target for clean-up.</span>
  <span class="hljs-string">"123456789012"</span>: <span class="hljs-comment"># Nuke this account</span>
    filters: <span class="hljs-comment"># Specify Filter to use for choosing resources to clean-up</span>
      IAMSAMLProvider: 
        - <span class="hljs-built_in">type</span>: <span class="hljs-string">"regex"</span>   <span class="hljs-comment"># You can use regex</span>
          value: <span class="hljs-string">"AWSSSO_.*_DO_NOT_DELETE"</span>
      IAMRole:
        - <span class="hljs-built_in">type</span>: <span class="hljs-string">"glob"</span>
          value: <span class="hljs-string">"AWSReservedSSO_*"</span>
      IAMRolePolicyAttachment:
        - <span class="hljs-built_in">type</span>: <span class="hljs-string">"glob"</span>
          value: <span class="hljs-string">"AWSReservedSSO_*"</span>
      IAMUser:            <span class="hljs-comment"># You can specify direct match</span>
        - <span class="hljs-string">"aws-nuke-access"</span>
      IAMUserPolicyAttachment:
        - <span class="hljs-string">"aws-nuke-access -&gt; AdministratorAccess"</span>
      IAMUserAccessKey:
        - <span class="hljs-string">"aws-nuke-access -&gt; ABCDEFGHFR2HABCDEFGH"</span>
      EC2KeyPair:
        - <span class="hljs-string">"my-keypair"</span>
</code></pre>
<p>This configuration will focus on the specified regions and ensure the <code>aws-nuke-access</code> IAM user, its policies, SSO roles, and <code>my-keypair</code> EC2 key pair are not deleted. etc.</p>
<p>There is a bit more elaborate starter configuration documented <a target="_blank" href="https://ekristen.github.io/aws-nuke/starter-config/">here</a>.</p>
<h3 id="heading-step-3-basic-commands">Step 3: Basic Commands 📝</h3>
<p>Once you have the configuration file let’s try some basic commands</p>
<pre><code class="lang-bash">aws-nuke --<span class="hljs-built_in">help</span>
aws-nuke explain-account --<span class="hljs-built_in">help</span>
aws-nuke explain-account -c config.yml
aws-nuke explain-config -c config.yml
</code></pre>
<p>The above is pretty self-explanatory. we are just trying to get help text and basic information of account and config based on the config file we have created.</p>
<h3 id="heading-step-4-dry-run-first">Step 4: Dry Run First 🚧</h3>
<p>💡 <strong>Pro tip</strong>: Always do a <strong>dry run</strong> first to see what resources will be deleted—just in case!</p>
<pre><code class="lang-bash">aws-nuke run -c config.yml --profile &lt;aws-profile&gt;
</code></pre>
<p>If everything looks good, you can add the <code>--no-dry-run</code> flag and proceed to the real thing!</p>
<h3 id="heading-step-5-nuke-time">Step 5: Nuke Time! 💣</h3>
<p>When you're ready to clean up your AWS account, simply run:</p>
<pre><code class="lang-bash">aws-nuke run -c  config.yml --profile &lt;aws-profile&gt; --no-dry-run
</code></pre>
<p><code>aws-nuke</code> will take it from here, and start cleaning up the resources listed in your config file. Depending on how many resources you have, this could take some time ⏳—so grab a coffee! ☕</p>
<h2 id="heading-safety-first-tips-to-stay-on-the-safe-side">🚨 Safety First: Tips to Stay on the Safe Side</h2>
<p>As powerful as <code>aws-nuke</code> is, it's important to use it carefully. Here are a few tips:</p>
<ul>
<li><p>✅ <strong>Always run a dry run</strong> before actually deleting anything.</p>
</li>
<li><p>📝 <strong>Double-check your configuration file</strong> to avoid accidentally nuking important resources.</p>
</li>
<li><p>📦 <strong>Backup critical data</strong> (e.g., S3 buckets, EC2 volumes) if needed, especially when running <code>aws-nuke</code> in production environments.</p>
</li>
</ul>
<h2 id="heading-known-pitfalls-and-things-to-watch-out-for">😬 Known Pitfalls and Things to Watch Out For</h2>
<p>While <code>aws-nuke</code> is an amazing tool, it’s not without a few quirks. Here are some <strong>common pitfalls</strong> to watch out for:</p>
<p><strong>1. Some Resources May Fail to Delete ⚠️</strong></p>
<p>Certain AWS resources may fail to delete on the first attempt due to things like resource locks, dependencies, or other constraints. If you encounter issues, rerun the utility to ensure everything gets cleaned up properly. Sometimes, a second or even third pass may be necessary to clear everything out.</p>
<p><strong>2. Long Execution Times for S3 Buckets with Large Object Counts 🕒</strong></p>
<p>If you have <strong>S3 buckets</strong> with a large number of objects, <code>aws-nuke</code> might take a long time to delete all the contents. In these cases, it can be faster to delete the bucket directly from the AWS Console.</p>
<h2 id="heading-wrapping-up">🏁 Wrapping Up</h2>
<p>And there you have it! <code>aws-nuke</code> is a great way to automate resource cleanup across your AWS accounts, saving you time and preventing unwanted costs. By following these steps, you’ll be able to easily install and use the tool to manage your AWS resources.</p>
<p>Remember to use <code>aws-nuke</code> carefully, and always review your resources before hitting that nuke button! 💥</p>
<p>For more details, check out the <a target="_blank" href="https://ekristen.github.io/aws-nuke/">official documentation</a>, and happy cleaning! 🧹</p>
]]></content:encoded></item><item><title><![CDATA[AWS Nuke ☢️💥 - what, why and when?]]></title><description><![CDATA[Let’s face it — managing cloud resources can get pretty chaotic. It’s like a digital junk drawer: you keep adding things, experimenting, and before you know it, you’ve got clutter everywhere! 🗄️
Don’t worry, though; there’s a way to clean up this cl...]]></description><link>https://blog.kloudwiz.com/aws-nuke-what-why-and-when</link><guid isPermaLink="true">https://blog.kloudwiz.com/aws-nuke-what-why-and-when</guid><category><![CDATA[AWS]]></category><category><![CDATA[aws nuke]]></category><category><![CDATA[AWS Cost Optimization]]></category><category><![CDATA[Cloud]]></category><category><![CDATA[cloudcostmanagement]]></category><category><![CDATA[Open Source]]></category><category><![CDATA[tools]]></category><category><![CDATA[cloud security]]></category><category><![CDATA[resource management]]></category><category><![CDATA[Resource Cleanup]]></category><dc:creator><![CDATA[Ishwar Galane]]></dc:creator><pubDate>Sun, 22 Sep 2024 13:30:51 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1726747171760/93c5eb17-094b-42b5-a5aa-ea026a7be477.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Let’s face it — managing cloud resources can get pretty chaotic. It’s like a digital junk drawer: you keep adding things, experimenting, and before you know it, you’ve got clutter everywhere! 🗄️</p>
<p>Don’t worry, though; there’s a way to clean up this cloud mess. Say hello to <strong>AWS Nuke</strong>! 🧹</p>
<p>In this article, we'll break down what AWS Nuke is, why you might need it, and when to use it in a simplified approach.</p>
<h3 id="heading-what-is-aws-nuke">What is AWS Nuke? 🤔</h3>
<p>Imagine you could snap your fingers and instantly clear out everything you don’t need in your cloud — AWS Nuke is pretty much that magic trick. ✨ It's a tool that lets you delete a bunch of resources in your AWS account, like virtual machines, storage buckets, databases, and more.</p>
<p>The best part? AWS Nuke gives you control. You can create a "keep" list to make sure it doesn’t delete anything important. It’s like having a supercharged vacuum cleaner for your cloud. 🧼🗑️ Just be careful — with great power comes great responsibility!</p>
<h3 id="heading-why-would-you-use-aws-nuke">Why Would You Use AWS Nuke? 🤷‍♀️</h3>
<p>We’ve all been there: you start using a new tool, trying things out, and before you know it, you’ve got a bunch of stuff cluttering up your account. Here are some real-life reasons you might want to use AWS Nuke:</p>
<ol>
<li><strong>Clean Up Non-Production Environments 🧽</strong></li>
</ol>
<p>If you’re working on projects, testing new apps, or learning new things, your AWS account can turn into a digital jungle. 🌱 It's easy to forget about old test servers, databases, or random files you created along the way. AWS Nuke helps you clear all that out so you can start fresh next time, like wiping your desk clean before starting a new project.</p>
<ol start="2">
<li><strong>Better Security 🛡️</strong></li>
</ol>
<p>Did you know that those forgotten cloud resources can be a security risk? 😱 Imagine a dusty old database hanging out in your account, holding sensitive information that could potentially be exposed. AWS Nuke can make sure there’s no forgotten treasure chest of data lying around, helping you keep things safe and secure.</p>
<ol start="3">
<li><strong>Save Some Money 💸</strong></li>
</ol>
<p>Cloud services charge you for what you use, and sometimes what you forget to clean up. 🕰️💰 It’s like leaving the lights on in rooms you’re not using — those costs add up! AWS Nuke helps you quickly get rid of resources you don’t need, so you’re only paying for what you actually use.</p>
<ol start="4">
<li><strong>Starting Fresh for Testing 🔄</strong></li>
</ol>
<p>If you’re testing out new software or automation scripts, you know the importance of starting with a clean slate. AWS Nuke lets you do that with a snap of your fingers. 🫰 It’s like wiping the whiteboard clean before starting a new brainstorming session.</p>
<ol start="5">
<li><strong>Closing or Handover an Account 📦➡️</strong></li>
</ol>
<p>Maybe you’re shutting down an AWS account or handing it over to someone else. You definitely don’t want to leave any loose ends. AWS Nuke makes sure you can pack up everything neatly and leave the account spotless for the next person. 🚪✨</p>
<h2 id="heading-when-should-you-use-aws-nuke">When Should You Use AWS Nuke? 🕰️</h2>
<p>This tool is powerful, so it’s important to know when to use it. Here are the situations where it makes sense to call in AWS Nuke:</p>
<ol>
<li><strong>For Non-Production Environments 🌱</strong></li>
</ol>
<p>AWS Nuke is <strong>not</strong> for your live, running applications — it’s best for development, testing, or sandbox accounts. You know, the playgrounds where you try things out and break things on purpose. 😅 Using it in production could cause chaos, so stick to the non-critical areas.</p>
<ol start="2">
<li><strong>After Testing or Experimenting for POCs 🧪</strong></li>
</ol>
<p>Did you try out some cool new service for a POC, but now your AWS account looks like a science lab? 🧬 AWS Nuke can help you clean it all up, so you don’t accidentally leave anything behind.</p>
<ol start="3">
<li><strong>Closing an Account 🚪</strong></li>
</ol>
<p>If you’re done with an AWS account and want to close it out, AWS Nuke ensures there’s no leftover data or forgotten resources hanging around. It’s like the final sweep before moving out of a house.</p>
<ol start="4">
<li><strong>Routine Maintenance 🗓️</strong></li>
</ol>
<p>Some teams schedule regular clean-ups to keep their cloud environments neat and cost-effective. 🧹 If that’s your style, AWS Nuke can be your trusted cleanup partner.</p>
<h2 id="heading-important-tips-before-using-aws-nuke">Important Tips Before Using AWS Nuke 📝</h2>
<ul>
<li><p><strong>Handle with Care:</strong> This tool can delete a lot quickly, so always double-check the list of resources it's about to remove. 🧐</p>
</li>
<li><p><strong>Back Up Critical Data:</strong> Make sure you’ve backed up anything important before using AWS Nuke.</p>
</li>
<li><p><strong>Get the Right Permissions:</strong> You’ll need proper permissions to delete things in AWS, so make sure you have the right access. 🔑</p>
</li>
<li><p><strong>Test First:</strong> Try it out in a small, safe environment before using it on bigger accounts. Better safe than sorry! 😉</p>
</li>
</ul>
<h2 id="heading-wrapping-up">Wrapping Up 🎁</h2>
<p>AWS Nuke is like a superhero janitor for your AWS cloud. 🦸‍♂️🧹 It's perfect for keeping things neat and under control in development and testing environments. By using it, you can avoid clutter, save money, and keep your cloud safe.</p>
<p>Just remember — use it wisely! Always review the list before hitting that final "confirm" button. 👍</p>
<p>Think of AWS Nuke as your cloud’s cleaning service. It’s there to help you start fresh, stay organised, and make sure nothing gets lost in the shuffle. Now, with this tool in your back pocket, you’re ready to tackle the cloud chaos like a pro! 🌥️💪</p>
<p>Stay tuned for the next one, 📝 where we will install and use the AWS Nuke utility.</p>
]]></content:encoded></item></channel></rss>