Skip to main content
VM Snooze SousChef

AWS Stopped InstancesLister

Professional PowerShell script that discovers and analyzes stopped EC2 instances across AWS accounts and regions. Fast AWS CLI integration with comprehensive CSV + HTML reporting for resource optimization.

Quick Start
# List all stopped instances
.\AWS-StoppedInstances.ps1
# Filter by age (30+ days)
.\AWS-StoppedInstances.ps1 -MinDays 30
# Specific regions
.\AWS-StoppedInstances.ps1 -Regions"us-east-1,us-west-2"
Blaze
Blaze says:Stopped instances aren't free -- their attached EBS volumes, Elastic IPs, and snapshots keep billing you. Use -MinDays 30 to find the real zombies, then check what's attached before you celebrate the savings.

Stopped instance audit quick start

Structured quick-reference sections for prerequisites, installation, usage, and troubleshooting.

Prerequisites

  • PowerShell 5.1+ or PowerShell Core for running the script
  • AWS CLI installed and authenticated (profile or default credentials)
  • Read-only IAM permissions for EC2 inventory across target regions/accounts
  • Local write access for CSV + HTML report output

Common parameters

ParameterPurposeExample
-MinDaysFilters instances stopped for at least N days30
-RegionsTargets specific AWS regions"us-east-1,us-west-2"
-ProfileUses a specific AWS CLI profile (if supported in your script version)"finance-audit"

Start with age filtering and region scoping before scanning every accessible region in large accounts.

Standard run path

  1. 1Run a full inventory first to establish the baseline of stopped EC2 instances.
  2. 2Apply `-MinDays 30` to isolate likely zombies and reduce review noise.
  3. 3Review attached EBS volumes, Elastic IPs, and snapshots before cleanup decisions.
  4. 4Use owner tags to route validation and remediation to the right team.
PowerShell
.\\AWS-StoppedInstances.ps1
PowerShell
.\\AWS-StoppedInstances.ps1 -MinDays 30
PowerShell
.\\AWS-StoppedInstances.ps1 -Regions "us-east-1,us-west-2" -MinDays 30

Outputs and prioritization

CSV + HTML reports

Use CSV for filtering and dashboards, and HTML for stakeholder-friendly reviews and lifecycle meetings.

Field / signalWhy it matters
Instance age / stopped durationPrioritizes likely abandoned instances
Region / account metadataRoutes cleanup to the correct owner
Attached storage/network referencesPrevents accidental cost misses or dependency breakage
Owner tagsSupports communication before termination/deletion
  • Stopped instances often continue incurring storage and IP costs even when compute charges stop.

Troubleshooting

  • If no instances are returned, verify AWS CLI authentication (`aws sts get-caller-identity`) and EC2 read permissions.
  • If some regions fail, start with explicit `-Regions` values to avoid restricted or disabled regions.
  • If results look incomplete, check the AWS profile/account context and rerun with a smaller regional scope.

Cleanup caution

Treat the report as a discovery list. Validate attached EBS volumes, AMI dependencies, and owner intent before deleting resources.

PowerShell + AWS CLI Excellence

Comprehensive analysis and reporting for stopped AWS EC2 instances with enterprise-grade performance

AWS CLI Integration

Native integration with AWS CLI for authenticated access and reliable data retrieval across accounts

Multi-Region Discovery

Automatically discovers all enabled regions or targets specific regions for focused analysis

Profile Management

Support for multiple AWS profiles with automatic authentication verification and credential handling

Parallel Processing

High-performance parallel scanning across regions with configurable concurrency limits

Instance State Analysis

Comprehensive analysis of stopped and optionally terminated instances with detailed metadata

Owner Detection

Extracts owner information from EC2 tags for accountability and lifecycle management

Age Analysis

Calculates days since instance launch with configurable age-based filtering for lifecycle decisions

Dual Report Formats

Generates both CSV (for analysis) and HTML (for executive reporting) with comprehensive breakdowns

Usage Examples

Real-world scenarios for AWS instance lifecycle management and optimization

Complete Account Scan

.\AWS-StoppedInstances.ps1

Discovers all stopped instances across your entire AWS account with automatic region discovery.

Age-Based Filtering

.\AWS-StoppedInstances.ps1 -MinDays 30

Focuses on instances stopped for 30+ days for lifecycle management and potential cleanup decisions.

Regional Analysis

.\AWS-StoppedInstances.ps1 -Regions"us-east-1,us-west-2"

Analyzes specific regions for targeted resource management and compliance reporting.

Profile-Specific Scanning

.\AWS-StoppedInstances.ps1 -Profile"production" -IncludeTerminated

Uses specific AWS profile and includes terminated instances for comprehensive lifecycle analysis.

Technical Specifications

Enterprise-grade PowerShell script with comprehensive AWS instance discovery capabilities

Requirements

PowerShell 5.1+

Modern PowerShell with parallel job support and advanced cmdlets

AWS CLI v2

AWS Command Line Interface installed and configured with proper authentication

AWS Authentication

Valid AWS credentials configured via AWS CLI, environment variables, or IAM roles

IAM Permissions

EC2 read permissions (ec2:DescribeInstances, ec2:DescribeRegions) across target regions

Network Connectivity

Internet access to AWS API endpoints

Command Line Parameters

-Regions

Comma-separated list of AWS regions to scan

-MinDays

Minimum days since launch to include instances (default: 0)

-OutputPath

Output directory for reports (default: current directory)

-MaxConcurrent

Maximum number of concurrent operations (default: 10)

-SkipRegions

Comma-separated list of regions to skip during scanning

-Profile

AWS CLI profile to use (default: default profile)

-IncludeTerminated

Include terminated instances in addition to stopped ones

Core Features

Discovery Engine

  • • Automatic region discovery via AWS CLI
  • • Parallel processing with configurable concurrency limits
  • • PowerShell job-based parallel execution
  • • Comprehensive error handling and retry logic

Data Processing

  • • Instance age calculation with timezone handling
  • • Owner extraction from EC2 tags
  • • Instance type, region, and availability zone analysis
  • • Storage analysis with EBS volume details

Reporting Capabilities

  • • CSV export for data analysis and integration
  • • Rich HTML reports with visual breakdowns
  • • Age distribution analysis with priority levels
  • • Regional and availability zone distribution charts

Performance Optimization

  • • Concurrent AWS CLI calls with job management
  • • Progress tracking and performance metrics
  • • Configurable concurrency limits for rate limiting
  • • Memory-efficient data processing and aggregation

Comprehensive Reporting

Professional reporting in multiple formats with detailed analytics and visual breakdowns

CSV Data Export

Structured CSV export optimized for data analysis, filtering, and integration with business intelligence tools.

Instance details and configuration
Age analysis and launch timestamps
Owner information from tag analysis
Regional and availability zone organization
Instance type and storage details

HTML Executive Report

Rich HTML report with visual analytics, age distribution charts, and executive-friendly presentation for stakeholder communication.

Executive summary with key metrics
Age distribution with priority levels
Regional and availability zone breakdowns
Top oldest instances analysis
Performance metrics and API statistics

Chef's Tips & Best Practices

Professional recommendations for effective AWS instance lifecycle management

AWS CLI Setup

Ensure AWS CLI is properly configured and authenticated before running the script. Like prepping your kitchen tools, proper setup ensures smooth operation.

Performance Tuning

Start with 5-10 concurrent jobs for large accounts to balance speed and API rate limits. Like managing multiple burners, find the right balance for your environment.

Regional Strategy

Use region filtering for focused analysis or to avoid regions with restricted access. Target specific regions like a chef selecting ingredients from trusted suppliers.

Age-Based Filtering

Start with 30+ day filters for initial cleanup identification. Like aging ingredients, some instances need time, but others may be forgotten and ready for cleanup.

Owner Engagement

Use the owner detection to reach out before cleanup decisions. The script identifies owners through EC2 tags, enabling proactive communication about instance lifecycle.

Report Integration

Import CSV reports into analytics tools for trend analysis. The structured output enables executive dashboards and automated lifecycle management workflows.

Ready to Optimize Your AWS Resources?

Download the AWS Stopped Instances Lister and start identifying optimization opportunities in your Amazon Web Services today. PowerShell + AWS CLI excellence for comprehensive instance discovery.

What to do next

Pick the path that fits where you are right now.

Trust & run-safety metadata

Key execution details for AWS VM Snooze SousChef so users know what they are downloading or running before they act.

Need verification guidance? See Security & Trust and Responsible Disclosure.

Read-only / reportingGitHub sourceExplicit + inferred metadata

Maintainer

CloudCostChefs

Last Updated

July 4, 2025

Last Tested

February 23, 2026

Minimum Access

Read-only EC2 visibility across target AWS accounts/regions plus valid AWS CLI credentials

Execution Type

GitHub-hosted PowerShell reporting script (AWS stopped EC2 inventory)

Version

2025-07-04

SHA256 Checksum

Not published yet (recommend adding checksum for downloadable files)

Verification Notes

GitHub-hosted AWS reporting script. Review AWS profile/role assumptions, regional scan settings, and output paths before automation.

Safe Usage Checklist

  • Validate findings with application owners before deleting volumes, snapshots, or associated resources linked to stopped instances.
  • Test on one account/region first to confirm permissions and CLI configuration are correct.
  • Run in a non-production subscription/account/tenancy first and capture sample output before broader rollout.
  • Use least-privilege access. Current best hint from docs: Read-only EC2 visibility across target AWS accounts/regions plus valid AWS CLI credentials.

Quick start (fast path)

Minimal steps to safely get value from this tool without reading the entire page first.

Estimated time: 5-10 minutes per accountDifficulty: IntermediateAccess: Review / read-only
  1. 1. Confirm scope and permissions

    Use least privilege and test in a non-production scope first. Minimum access hint: Read-only EC2 visibility across target AWS accounts/regions plus valid AWS CLI credentials.

  2. 2. Get the tool package / source

    View on GitHub and review the files before running.

    GitHub
  3. 3. Check prerequisites

    • ✅ PowerShell 5.1+ with parallel job support and advanced cmdlets
    • ✅ AWS CLI v2 installed and configured with proper authentication
    • ✅ Valid AWS credentials configured via AWS CLI, environment variables, or IAM roles
  4. 4. Run safely and review output

    GitHub-hosted AWS reporting script. Review AWS profile/role assumptions, regional scan settings, and output paths before automation. Start with a small sample scope, then expand once results look correct.