Find and Price Unused Google Cloud Resources with Zombiescan
Job to be done: Scan Google Cloud projects for unused resources and estimate cleanup costs
🇳🇬 Ways to use this in Nigeria
Ideas to get you started, adapt to your situation.
- 9-5 employee
As an employee in a tech role, generate a report of unused Google Cloud resources (like idle VMs or unattached storage) across your company's projects to identify cost-saving opportunities for your department.
- Entrepreneur
As an entrepreneur, scan your Google Cloud projects to find idle databases or unattached storage disks, then estimate cleanup costs to reduce your monthly infrastructure bill for your startup.
What you’ll get
You will build and run a command-line tool that scans your Google Cloud projects for resources that are no longer in use but are still costing you money. This tool helps you identify and estimate the cost of cleaning up these ‘ghost’ resources, saving you money on your cloud bill. It’s useful for anyone managing cloud infrastructure who wants to avoid unnecessary expenses.
Tools you need
- Zombiescan GCP (free): A command-line tool to scan Google Cloud for unused resources.
- Google Cloud (paid): Your cloud computing platform where your projects and resources are hosted. Usage of resources incurs costs.
- Python (free): A programming language used to build and run the Zombiescan tool.
- gcloud CLI (free): The command-line interface for Google Cloud, used for authentication and managing cloud resources.
Steps
-
Clone the tool’s code: Download the Zombiescan tool from its online code repository.
git clone https://github.com/xbill9/zombiescan-gcpYou should see a new folder named
zombiescan-gcpappear in your file system. -
Navigate into the tool’s directory: Open your command line and go into the folder you just downloaded.
cd zombiescan-gcpYour command prompt should now show that you are inside the
zombiescan-gcpdirectory. -
Install the tool’s dependencies: This command installs all the necessary libraries for Zombiescan to run, using a tool called
uv.uv syncYou will see a list of packages being installed. This might take a minute or two.
-
Check the tool’s version: Verify that the tool is installed correctly by checking its version.
uv run zombiescan --versionYou should see output like
zombiescan, version 0.1.0. -
Install Zombiescan globally: This makes the
zombiescancommand available from any directory on your computer.uv tool install git+https://github.com/xbill9/zombiescan-gcpThis step might take a few minutes as it installs the tool system-wide.
-
Authenticate with Google Cloud: Log in to your Google Cloud account using the command-line tool. This allows Zombiescan to access your projects.
gcloud auth application-default loginYour web browser will open, prompting you to log in to your Google account and grant permissions. Once completed, you can close the browser tab.
-
List available checks: See what types of unused resources Zombiescan can look for.
zombiescan checksYou will see a list of checks, such as
disabled-kms-key,empty-vpc-network, andgke-idle-cluster.
Original source
This workflow is based on a guide by xbill, originally posted on the DEV Community platform. The author explains how to build a command-line tool from source code to find and price unused resources in Google Cloud projects, helping users reduce their cloud spending.
Notes & variations
- Free tier alternative: There isn’t a direct free tier alternative for scanning Google Cloud resources. However, Google Cloud’s own ‘Recommender’ tool offers some suggestions for cost optimization, though it may not be as comprehensive as Zombiescan.
- Common pitfall: Ensure you have the
gcloudcommand-line tool installed and properly authenticated before running the scan. If authentication fails, Zombiescan won’t be able to access your projects. - Tip for better results: To get the most accurate cost estimates, make sure your Google Cloud Billing account is correctly set up and that the user account you authenticate with has sufficient read permissions across all the projects you want to scan.