runbooks 1.1.1__py3-none-any.whl → 1.1.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. runbooks/__init__.py +1 -1
  2. runbooks/cfat/assessment/collectors.py +3 -2
  3. runbooks/cloudops/cost_optimizer.py +235 -83
  4. runbooks/cloudops/models.py +8 -2
  5. runbooks/common/aws_pricing.py +12 -0
  6. runbooks/common/business_logic.py +1 -1
  7. runbooks/common/profile_utils.py +213 -310
  8. runbooks/common/rich_utils.py +15 -21
  9. runbooks/finops/README.md +3 -3
  10. runbooks/finops/__init__.py +13 -5
  11. runbooks/finops/business_case_config.py +5 -5
  12. runbooks/finops/cli.py +170 -95
  13. runbooks/finops/cost_optimizer.py +2 -1
  14. runbooks/finops/cost_processor.py +69 -22
  15. runbooks/finops/dashboard_router.py +3 -3
  16. runbooks/finops/dashboard_runner.py +3 -4
  17. runbooks/finops/embedded_mcp_validator.py +101 -23
  18. runbooks/finops/enhanced_progress.py +213 -0
  19. runbooks/finops/finops_scenarios.py +90 -16
  20. runbooks/finops/markdown_exporter.py +4 -2
  21. runbooks/finops/multi_dashboard.py +1 -1
  22. runbooks/finops/nat_gateway_optimizer.py +85 -57
  23. runbooks/finops/rds_snapshot_optimizer.py +1389 -0
  24. runbooks/finops/scenario_cli_integration.py +212 -22
  25. runbooks/finops/scenarios.py +41 -25
  26. runbooks/finops/single_dashboard.py +68 -9
  27. runbooks/finops/tests/run_tests.py +5 -3
  28. runbooks/finops/vpc_cleanup_optimizer.py +1 -1
  29. runbooks/finops/workspaces_analyzer.py +40 -16
  30. runbooks/inventory/list_rds_snapshots_aggregator.py +745 -0
  31. runbooks/main.py +393 -61
  32. runbooks/operate/executive_dashboard.py +4 -3
  33. runbooks/remediation/rds_snapshot_list.py +13 -0
  34. {runbooks-1.1.1.dist-info → runbooks-1.1.3.dist-info}/METADATA +234 -40
  35. {runbooks-1.1.1.dist-info → runbooks-1.1.3.dist-info}/RECORD +39 -37
  36. {runbooks-1.1.1.dist-info → runbooks-1.1.3.dist-info}/WHEEL +0 -0
  37. {runbooks-1.1.1.dist-info → runbooks-1.1.3.dist-info}/entry_points.txt +0 -0
  38. {runbooks-1.1.1.dist-info → runbooks-1.1.3.dist-info}/licenses/LICENSE +0 -0
  39. {runbooks-1.1.1.dist-info → runbooks-1.1.3.dist-info}/top_level.txt +0 -0
@@ -75,7 +75,7 @@ class WorkSpacesCostAnalyzer:
75
75
  """
76
76
  WorkSpaces cost optimization analyzer following enterprise patterns.
77
77
 
78
- Implements FinOps-24 requirements with proven profile management and Rich CLI standards.
78
+ Implements WorkSpaces optimization requirements with proven profile management and Rich CLI standards.
79
79
  """
80
80
 
81
81
  def __init__(self, profile: Optional[str] = None):
@@ -84,7 +84,7 @@ class WorkSpacesCostAnalyzer:
84
84
  self.profile = get_profile_for_operation("operational", profile)
85
85
  self.session = boto3.Session(profile_name=self.profile)
86
86
 
87
- # FinOps-24 business targets
87
+ # WorkSpaces optimization business targets
88
88
  self.target_annual_savings = 12518.0
89
89
  self.unused_threshold_days = 90
90
90
  self.analysis_period_days = 30
@@ -286,7 +286,7 @@ class WorkSpacesCostAnalyzer:
286
286
  print_header("WorkSpaces Cost Analysis Summary")
287
287
 
288
288
  summary_table = create_table(
289
- title="FinOps-24: WorkSpaces Optimization Summary",
289
+ title="WorkSpaces Optimization Summary",
290
290
  columns=[
291
291
  {"header": "Metric", "style": "cyan"},
292
292
  {"header": "Count", "style": "green bold"},
@@ -532,7 +532,7 @@ class WorkSpacesCostAnalyzer:
532
532
  }
533
533
 
534
534
 
535
- def analyze_workspaces_finops_24(
535
+ def analyze_workspaces(
536
536
  profile: Optional[str] = None,
537
537
  unused_days: int = 90,
538
538
  analysis_days: int = 30,
@@ -541,7 +541,7 @@ def analyze_workspaces_finops_24(
541
541
  dry_run: bool = True
542
542
  ) -> Dict[str, Any]:
543
543
  """
544
- FinOps-24 WorkSpaces analysis wrapper for CLI and notebook integration.
544
+ WorkSpaces analysis wrapper for CLI and notebook integration.
545
545
 
546
546
  Args:
547
547
  profile: AWS profile to use
@@ -555,6 +555,11 @@ def analyze_workspaces_finops_24(
555
555
  Analysis results with cost optimization recommendations
556
556
  """
557
557
  try:
558
+ # Initialize variables to prevent scope errors
559
+ results = []
560
+ summary = None
561
+ export_file = None
562
+
558
563
  analyzer = WorkSpacesCostAnalyzer(profile=profile)
559
564
  results, summary = analyzer.analyze_workspaces(
560
565
  unused_days=unused_days,
@@ -573,17 +578,36 @@ def analyze_workspaces_finops_24(
573
578
  )
574
579
 
575
580
  # Return comprehensive results
576
- return {
577
- "summary": summary.to_dict(),
578
- "workspaces": [result.to_dict() for result in results],
579
- "export_file": export_file,
580
- "achievement_rate": summary.target_achievement_rate,
581
- "status": "success"
582
- }
583
-
581
+ if summary is not None:
582
+ return {
583
+ "summary": summary.to_dict(),
584
+ "workspaces": [result.to_dict() for result in results],
585
+ "export_file": export_file,
586
+ "achievement_rate": summary.target_achievement_rate,
587
+ "status": "success"
588
+ }
589
+ else:
590
+ return {
591
+ "summary": {"error": "Analysis failed before completion"},
592
+ "workspaces": [],
593
+ "export_file": None,
594
+ "achievement_rate": 0,
595
+ "status": "partial_failure"
596
+ }
597
+
584
598
  except Exception as e:
585
- print_error(f"FinOps-24 analysis failed: {e}")
599
+ print_error(f"WorkSpaces analysis failed: {e}")
586
600
  return {
587
601
  "error": str(e),
588
- "status": "failed"
589
- }
602
+ "status": "failed",
603
+ "summary": {"error": str(e)},
604
+ "workspaces": [],
605
+ "export_file": None,
606
+ "achievement_rate": 0
607
+ }
608
+
609
+
610
+ # Legacy alias for backward compatibility
611
+ def analyze_workspaces_finops_24(*args, **kwargs):
612
+ """Legacy alias for analyze_workspaces - deprecated, use analyze_workspaces instead."""
613
+ return analyze_workspaces(*args, **kwargs)