Skip to content

[CC-008] Org mode skips usage type filtering #20

@LFigg

Description

@LFigg

Description

When running in AWS Organization mode (--org-costs), usage type filtering may be skipped, potentially including non-backup costs in the output.

Location

  • File: cost_collect.py - Organization cost collection logic

Impact

  • Medium - Inflated cost numbers in org mode
  • Inconsistent results between single-account and org modes

Suggested Fix

Ensure the same usage type filters are applied regardless of collection mode:

# Should apply to both single-account and org modes
BACKUP_USAGE_TYPES = [
    'SnapshotUsage',
    'CreateSnapshot',
    'Storage',
    ...
]

def filter_backup_costs(costs: list, mode: str) -> list:
    """Filter to backup-related costs only."""
    # Same logic for both modes
    return [c for c in costs if c['usage_type'] in BACKUP_USAGE_TYPES]

Priority

Medium

Source

cost_collect.py code review - CC-008

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions