Skip to content

runbooks inventory score-decommissionΒΆ

Auto-generated from runbooks inventory score-decommission --help on 2026-05-21. Source of truth: runbooks PyPI package v1.3.22

Usage: runbooks inventory score-decommission [OPTIONS]

  Score resources for decommissioning (E1-E7 for EC2 or W1-W6 for WorkSpaces).

  Adds 3 columns to fully enriched data: - decommission_score: 0-100 point
  score - decommission_tier: MUST (80-100) | SHOULD (50-79) | COULD (25-49) |
  KEEP (<25) - signal_breakdown: JSON object showing which signals triggered
  (E1-E7 or W1-W6)

  Signal Scoring (EC2 - E1-E7): - E1: Compute Optimizer idle (60 points) -
  BACKBONE SIGNAL - E2: CloudWatch CPU/Network (10 points) - E3: CloudTrail
  activity (8 points) - E4: SSM heartbeat (8 points) - E5: Service attachment
  (6 points) - E6: Storage I/O (5 points) - E7: Cost savings (3 points)

  Signal Scoring (WorkSpaces - W1-W6): - W1: Connection recency (45 points) -
  W2: CloudWatch usage (25 points) - W3: Billing vs usage (10/5 points) - W4:
  Cost Optimizer policy (10 points) - W5: Admin activity (5 points) - W6: User
  status (5 points)

  Advanced Filtering:     - --score-threshold: Filter to resources above
  minimum score     - --tier-filter: Filter to specific tier (MUST, SHOULD,
  COULD, KEEP)     - --min-monthly-cost: Filter to resources above cost
  threshold     - --exclude-signals: Exclude specific signals from scoring
  - --custom-weights: Override default signal weights (JSON)

  Examples:     # Standard EC2 decommission scoring     runbooks inventory
  score-decommission \       --input /tmp/ec2-fully-enriched.csv \
  --resource-type ec2 \       --output /tmp/ec2-scored.csv

      # High-priority candidates only (MUST tier, >$50/month)     runbooks
      inventory score-decommission \       --input /tmp/ec2-fully-enriched.csv
      \       --resource-type ec2 \       --tier-filter MUST --min-monthly-
      cost 50.0 \       --output /tmp/ec2-high-priority.csv

      # Custom scoring (emphasize Compute Optimizer)     runbooks inventory
      score-decommission \       --input /tmp/ec2-fully-enriched.csv \
      --resource-type ec2 \       --custom-weights '{"E1": 70, "E2": 15, "E3":
      10, "E4": 5}' \       --output /tmp/ec2-custom-scoring.csv

      # Exclude CloudTrail signal (E3) from scoring     runbooks inventory
      score-decommission \       --input /tmp/ec2-fully-enriched.csv \
      --resource-type ec2 \       --exclude-signals E3,E4 \       --output
      /tmp/ec2-no-cloudtrail.csv

  Requirements:     - Input must have ALL 4 enrichment layers complete:
  1. Discovery (resource-explorer)       2. Organizations (enrich-accounts)
  3. Costs (enrich-costs)       4. Activity (enrich-activity)

Options:
  --tags TEXT                     Filter by tags (key=value format)
  --accounts TEXT                 Filter by specific account IDs
  --all                           Multi-account discovery
                                  (CENTRALISED_OPS_PROFILE as aggregator).

                                  πŸ“‹ Behavior: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                                  ━━━━━━━━━━━━━━━

                                  β€’ Queries AWS Resource Explorer aggregator
                                  index β€’ Discovers resources across ALL
                                  accounts in Landing Zone β€’ Requires
                                  CENTRALISED_OPS_PROFILE with cross-account
                                  permissions

                                  πŸ” Enrichment Layers (Automatic):   β€’
                                  Organizations metadata: MANAGEMENT_PROFILE
                                  β€’ Cost data: BILLING_PROFILE   Note:
                                  Enrichment uses separate profiles regardless
                                  of discovery mode

                                  Use Case: Enterprise platform teams managing
                                  67+ account Landing Zones
  --profiles TEXT                 Specific AWS profiles (comma-separated,
                                  e.g., "billing,security,audit")
  --regions TEXT                  Specific AWS regions (space-separated)
  --all-regions                   Process all enabled AWS regions
  -f, --format, --output-format [json|csv|table|pdf|markdown]
                                  Output format for results display
                                  (-f/--format preferred, --output-format
                                  legacy)
  --output-dir PATH               Directory for generated files and evidence
                                  packages
  --all-outputs                   Generate all output formats (JSON, CSV, PDF,
                                  Markdown) - use with --output-dir
  --csv                           Export to CSV format (convenience flag,
                                  activates --all-outputs)
  --json                          Export to JSON format (convenience flag,
                                  activates --all-outputs)
  --markdown                      Export to Markdown format (convenience flag,
                                  activates --all-outputs)
  --profile TEXT                  AWS profile for single-account operations.

                                  πŸ“‹ Profile Selection Guide: ━━━━━━━━━━━━━━━━━
                                  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

                                  Single Account β†’ Use --profile YOUR_PROFILE
                                  Example: --profile dev-account   When:
                                  Developer/operator working in one AWS
                                  account

                                  Multi-Account LZ β†’ Use --all-profiles (see
                                  inventory commands)   Example: --all-
                                  profiles   When: Platform team discovering
                                  across organization

                                  πŸ” Enrichment Profiles (Automatic):   β€’
                                  Organizations: MANAGEMENT_PROFILE   β€’ Costs:
                                  BILLING_PROFILE   Note: Separate from
                                  discovery profile

                                  Decision: Single account = --profile |
                                  Multi-account = --all-profiles
  --region TEXT                   AWS region override (default: ap-
                                  southeast-2)
  --dry-run                       Safe analysis mode - no resource
                                  modifications (enterprise default)
  --input PATH                    Fully enriched CSV (all 5 layers: Discovery
                                  + Organizations + Costs + Activity +
                                  Scoring)  [required]
  --resource-type [ec2|workspaces]
                                  Resource type to score (ec2 or workspaces)
                                  [required]
  --score-threshold INTEGER       Minimum decommission score for inclusion
                                  (e.g., 50 for SHOULD+ tier)
  --tier-filter [MUST|SHOULD|COULD|KEEP]
                                  Filter output to specific decommission tier
  --min-monthly-cost FLOAT        Minimum monthly cost threshold (e.g., 10.0
                                  for >$10/month)
  --custom-weights TEXT           JSON string for custom signal weights (e.g.,
                                  '{"E1": 70, "E2": 15}')
  --exclude-signals TEXT          Comma-separated signals to exclude (e.g.,
                                  'E3,E4' or 'W2,W5')
  --include-zero-cost             Include resources with no cost data in
                                  output
  --output PATH                   Output CSV with decommission scores
                                  [required]
  --console-format                Display Rich table to console AND export CSV
                                  (dual output)
  -v, --verbose                   Show detailed execution logs
  --format-output [compact|table|json]
                                  Output format (renamed from --format to
                                  avoid conflict)
  --help                          Show this message and exit.

ExamplesΒΆ