runbooks 1.1.2__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.
- runbooks/__init__.py +1 -1
- runbooks/cloudops/cost_optimizer.py +158 -22
- runbooks/common/business_logic.py +1 -1
- runbooks/common/rich_utils.py +5 -5
- runbooks/finops/README.md +3 -3
- runbooks/finops/cli.py +169 -103
- runbooks/finops/embedded_mcp_validator.py +101 -23
- runbooks/finops/finops_scenarios.py +90 -16
- runbooks/finops/rds_snapshot_optimizer.py +1389 -0
- runbooks/finops/vpc_cleanup_optimizer.py +1 -1
- runbooks/finops/workspaces_analyzer.py +30 -12
- runbooks/inventory/list_rds_snapshots_aggregator.py +745 -0
- runbooks/main.py +309 -38
- {runbooks-1.1.2.dist-info → runbooks-1.1.3.dist-info}/METADATA +1 -1
- {runbooks-1.1.2.dist-info → runbooks-1.1.3.dist-info}/RECORD +19 -17
- {runbooks-1.1.2.dist-info → runbooks-1.1.3.dist-info}/WHEEL +0 -0
- {runbooks-1.1.2.dist-info → runbooks-1.1.3.dist-info}/entry_points.txt +0 -0
- {runbooks-1.1.2.dist-info → runbooks-1.1.3.dist-info}/licenses/LICENSE +0 -0
- {runbooks-1.1.2.dist-info → runbooks-1.1.3.dist-info}/top_level.txt +0 -0
@@ -1323,7 +1323,7 @@ class VPCCleanupOptimizer:
|
|
1323
1323
|
monthly_vpc_endpoint_cost = endpoint_result.monthly_cost
|
1324
1324
|
|
1325
1325
|
# Data processing costs vary by usage - using conservative estimate per region
|
1326
|
-
regional_multiplier = pricing_engine.
|
1326
|
+
regional_multiplier = pricing_engine.get_regional_pricing_multiplier('vpc_endpoint', default_region, "us-east-1")
|
1327
1327
|
monthly_data_processing_cost = 50.0 * regional_multiplier # Base estimate adjusted for region
|
1328
1328
|
|
1329
1329
|
total_annual_savings = 0.0
|
@@ -75,7 +75,7 @@ class WorkSpacesCostAnalyzer:
|
|
75
75
|
"""
|
76
76
|
WorkSpaces cost optimization analyzer following enterprise patterns.
|
77
77
|
|
78
|
-
Implements
|
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
|
-
#
|
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="
|
289
|
+
title="WorkSpaces Optimization Summary",
|
290
290
|
columns=[
|
291
291
|
{"header": "Metric", "style": "cyan"},
|
292
292
|
{"header": "Count", "style": "green bold"},
|
@@ -555,6 +555,11 @@ def analyze_workspaces(
|
|
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,19 +578,32 @@ def analyze_workspaces(
|
|
573
578
|
)
|
574
579
|
|
575
580
|
# Return comprehensive results
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
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
599
|
print_error(f"WorkSpaces analysis failed: {e}")
|
586
600
|
return {
|
587
601
|
"error": str(e),
|
588
|
-
"status": "failed"
|
602
|
+
"status": "failed",
|
603
|
+
"summary": {"error": str(e)},
|
604
|
+
"workspaces": [],
|
605
|
+
"export_file": None,
|
606
|
+
"achievement_rate": 0
|
589
607
|
}
|
590
608
|
|
591
609
|
|