The Silent Drain: Unused AWS Resources

Cloud environments, particularly at scale, are complex. Migrations, project pivots, and evolving architectures can leave behind a trail of digital detritus. These are AWS resources that are no longer serving their intended purpose but continue to incur charges. Think of an Elastic IP address that outlived the instance it was assigned to, or a detached EBS volume that wasn't cleaned up after a server decommissioning. These 'zombie' resources, as they are often called, represent a silent but significant drain on cloud budgets.

While AWS Cost Explorer provides a high-level overview of spending and AWS Trusted Advisor offers some recommendations, pinpointing specific, underutilized assets can be a manual and time-consuming process. The challenge lies in the sheer variety of services and the potential for resources to become orphaned. A volume might survive the instance it was attached to, an Elastic IP might outlive the migration that freed it, or a NAT gateway could remain active in a VPC whose workload was torn down months ago. Each of these instances bills by the hour and often reports no active usage, making them invisible to standard monitoring tools.

The impact of these forgotten assets is substantial. Individually, they might cost a few dollars a month, but collectively, across an organization, these small charges can escalate into thousands of dollars in wasted expenditure. This is precisely the problem the zombiescan tool aims to solve.

Python script output showing a list of orphaned AWS resources and their estimated monthly costs

Introducing Zombiescan: Your AWS Resource Auditor

zombiescan is a suite of Python scripts designed to systematically audit an AWS account for resources that are no longer in active use. It goes beyond basic cost reporting by actively identifying specific classes of orphaned assets and quantifying their potential cost. The tool covers a broad spectrum of AWS services, including storage, compute, networking, data services, and account-wide services that operate outside of specific regions.

The methodology involves a series of checks. For storage, it looks for unattached EBS volumes, unassociated Elastic IP addresses, and S3 buckets that may not be actively accessed or are configured with excessive lifecycle policies that don't reduce cost. In compute, it identifies EC2 instances that are stopped but still have associated Elastic IPs or EBS volumes attached, or even running instances that report no network traffic for an extended period. Networking resources like unattached Elastic Load Balancers (ELBs) or NAT gateways in inactive VPCs are also flagged. Data services such as RDS instances that are stopped but not terminated, or ElastiCache clusters with no active connections, are also within its scope.

What makes zombiescan particularly valuable is its ability to generate a concrete figure for each identified resource and its monthly cost. This is achieved by cross-referencing the identified orphaned resources with the AWS Price List API. By understanding the specific resource type and its configuration, the tool can query the pricing information to provide an estimated monthly cost. This granular data is crucial for making informed decisions about which resources to terminate. Instead of a general cost overview, you get a specific line item: 'This detached EBS volume is costing you $4.50 per month.' This direct cost attribution is a powerful motivator for cleanup.

The Technical Approach and Resource Classes

The zombiescan project, available on GitHub, provides the underlying code for these checks. It leverages the AWS SDK for Python (Boto3) to interact with various AWS services. The script iterates through different resource types, querying their current state and associated metadata. For instance, to find orphaned EBS volumes, it would list all EBS volumes and then check if each volume is currently attached to a running EC2 instance. Volumes that are present but not attached are flagged.

Similarly, for Elastic IPs, the script lists all allocated Elastic IPs and checks their association status. An EIP that is allocated but not associated with a running instance is a prime candidate for cleanup. The tool also considers resources that might be technically 'in use' but effectively abandoned. This could include EC2 instances that are in a 'stopped' state but still incur charges for attached EBS volumes or Elastic IPs. The script intelligently differentiates between intentionally stopped instances awaiting restart and forgotten ones.

zombiescan currently covers approximately 22 classes of resources, representing a significant portion of common cloud spending. These classes include:

  • EBS Volumes (unattached)
  • Elastic IPs (unassociated)
  • EC2 Instances (stopped with attached resources)
  • NAT Gateways (in inactive VPCs)
  • Elastic Load Balancers (unattached or with no targets)
  • RDS Instances (stopped or with no connections)
  • S3 Buckets (potentially unaccessed, depending on configuration)
  • CloudWatch Alarms (orphaned)
  • Snapshots (old and unassociated)
  • And several others across compute, storage, and networking.

The output is designed to be actionable. Each identified resource is presented with its ID, type, region (if applicable), and the estimated monthly cost. This allows teams to prioritize cleanup efforts based on the financial impact. A resource costing $100 per month will naturally take precedence over one costing $0.50.

The Broader Implications for Cloud Cost Management

The proliferation of unused cloud resources is a universal problem. As organizations grow and their cloud footprints expand, the likelihood of 'cloud sprawl' increases. This isn't just an issue for large enterprises; startups and small businesses can also fall victim to accumulating unnecessary costs, especially as they iterate rapidly on products and services. The ephemeral nature of cloud infrastructure, while powerful, also means that resources can be spun up and forgotten with relative ease.

Tools like zombiescan represent a crucial step towards more proactive and efficient cloud cost management. They shift the paradigm from reactive cost reduction (cutting services when budgets are tight) to preventative optimization (identifying and eliminating waste before it accumulates). By providing developers and operations teams with clear, actionable data, these tools empower them to take ownership of their resource consumption and associated costs.

The surprising detail here is not the existence of unused resources, which is a well-known problem, but the structured, programmatic approach to quantifying their impact and mapping it to specific AWS pricing. This moves beyond generic advice to provide concrete, data-driven insights that can directly inform decision-making. If you run a team that manages AWS infrastructure, even a small one, dedicating time to audit your account for these 'zombie' resources could yield significant savings. The effort required to run a tool like zombiescan is often orders of magnitude less than the cost of the resources it helps you find.

What nobody has addressed yet is the integration of such tools into CI/CD pipelines or automated governance frameworks. While zombiescan is excellent for periodic audits, embedding similar checks into the deployment process could prevent resources from becoming orphaned in the first place. Imagine a deployment script that automatically checks for and flags potential orphaned resources before a new build is finalized, or a policy that requires justification for any resource exceeding a certain idle threshold.