runbooks 0.9.8__py3-none-any.whl → 1.0.0__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/cfat/cloud_foundations_assessment.py +626 -0
- runbooks/cloudops/cost_optimizer.py +95 -33
- runbooks/common/aws_pricing.py +388 -0
- runbooks/common/aws_pricing_api.py +205 -0
- runbooks/common/aws_utils.py +2 -2
- runbooks/common/comprehensive_cost_explorer_integration.py +979 -0
- runbooks/common/cross_account_manager.py +606 -0
- runbooks/common/enhanced_exception_handler.py +4 -0
- runbooks/common/env_utils.py +96 -0
- runbooks/common/mcp_integration.py +49 -2
- runbooks/common/organizations_client.py +579 -0
- runbooks/common/profile_utils.py +96 -2
- runbooks/common/rich_utils.py +3 -0
- runbooks/finops/cost_optimizer.py +2 -1
- runbooks/finops/elastic_ip_optimizer.py +13 -9
- runbooks/finops/embedded_mcp_validator.py +31 -0
- runbooks/finops/enhanced_trend_visualization.py +3 -2
- runbooks/finops/markdown_exporter.py +441 -0
- runbooks/finops/nat_gateway_optimizer.py +57 -20
- runbooks/finops/optimizer.py +2 -0
- runbooks/finops/single_dashboard.py +2 -2
- runbooks/finops/vpc_cleanup_exporter.py +330 -0
- runbooks/finops/vpc_cleanup_optimizer.py +895 -40
- runbooks/inventory/__init__.py +10 -1
- runbooks/inventory/cloud_foundations_integration.py +409 -0
- runbooks/inventory/core/collector.py +1148 -88
- runbooks/inventory/discovery.md +389 -0
- runbooks/inventory/drift_detection_cli.py +327 -0
- runbooks/inventory/inventory_mcp_cli.py +171 -0
- runbooks/inventory/inventory_modules.py +4 -7
- runbooks/inventory/mcp_inventory_validator.py +2149 -0
- runbooks/inventory/mcp_vpc_validator.py +23 -6
- runbooks/inventory/organizations_discovery.py +91 -1
- runbooks/inventory/rich_inventory_display.py +129 -1
- runbooks/inventory/unified_validation_engine.py +1292 -0
- runbooks/inventory/verify_ec2_security_groups.py +3 -1
- runbooks/inventory/vpc_analyzer.py +825 -7
- runbooks/inventory/vpc_flow_analyzer.py +36 -42
- runbooks/main.py +969 -42
- runbooks/monitoring/performance_monitor.py +11 -7
- runbooks/operate/dynamodb_operations.py +6 -5
- runbooks/operate/ec2_operations.py +3 -2
- runbooks/operate/networking_cost_heatmap.py +4 -3
- runbooks/operate/s3_operations.py +13 -12
- runbooks/operate/vpc_operations.py +50 -2
- runbooks/remediation/base.py +1 -1
- runbooks/remediation/commvault_ec2_analysis.py +6 -1
- runbooks/remediation/ec2_unattached_ebs_volumes.py +6 -3
- runbooks/remediation/rds_snapshot_list.py +5 -3
- runbooks/validation/__init__.py +21 -1
- runbooks/validation/comprehensive_2way_validator.py +1996 -0
- runbooks/validation/mcp_validator.py +904 -94
- runbooks/validation/terraform_citations_validator.py +363 -0
- runbooks/validation/terraform_drift_detector.py +1098 -0
- runbooks/vpc/cleanup_wrapper.py +231 -10
- runbooks/vpc/config.py +310 -62
- runbooks/vpc/cross_account_session.py +308 -0
- runbooks/vpc/heatmap_engine.py +96 -29
- runbooks/vpc/manager_interface.py +9 -9
- runbooks/vpc/mcp_no_eni_validator.py +1551 -0
- runbooks/vpc/networking_wrapper.py +14 -8
- runbooks/vpc/runbooks.inventory.organizations_discovery.log +0 -0
- runbooks/vpc/runbooks.security.report_generator.log +0 -0
- runbooks/vpc/runbooks.security.run_script.log +0 -0
- runbooks/vpc/runbooks.security.security_export.log +0 -0
- runbooks/vpc/tests/test_cost_engine.py +1 -1
- runbooks/vpc/unified_scenarios.py +3269 -0
- runbooks/vpc/vpc_cleanup_integration.py +516 -82
- {runbooks-0.9.8.dist-info → runbooks-1.0.0.dist-info}/METADATA +94 -52
- {runbooks-0.9.8.dist-info → runbooks-1.0.0.dist-info}/RECORD +75 -51
- {runbooks-0.9.8.dist-info → runbooks-1.0.0.dist-info}/WHEEL +0 -0
- {runbooks-0.9.8.dist-info → runbooks-1.0.0.dist-info}/entry_points.txt +0 -0
- {runbooks-0.9.8.dist-info → runbooks-1.0.0.dist-info}/licenses/LICENSE +0 -0
- {runbooks-0.9.8.dist-info → runbooks-1.0.0.dist-info}/top_level.txt +0 -0
@@ -19,11 +19,12 @@ from rich.panel import Panel
|
|
19
19
|
from rich.progress import Progress, SpinnerColumn, TextColumn
|
20
20
|
from rich.table import Table
|
21
21
|
|
22
|
-
from runbooks.common.profile_utils import create_operational_session
|
22
|
+
from runbooks.common.profile_utils import create_operational_session, create_cost_session, create_management_session
|
23
23
|
from runbooks.common.rich_utils import (
|
24
24
|
console, print_header, print_success, print_error, print_warning, print_info,
|
25
25
|
create_table, create_progress_bar, format_cost, STATUS_INDICATORS
|
26
26
|
)
|
27
|
+
from runbooks.common.env_utils import get_required_env_float
|
27
28
|
|
28
29
|
from .cost_engine import NetworkingCostEngine
|
29
30
|
from .heatmap_engine import NetworkingCostHeatMapEngine
|
@@ -89,6 +90,7 @@ class VPCNetworkingWrapper:
|
|
89
90
|
# Results storage
|
90
91
|
self.last_results = {}
|
91
92
|
|
93
|
+
|
92
94
|
def analyze_nat_gateways(self, days: int = 30) -> Dict[str, Any]:
|
93
95
|
"""
|
94
96
|
Analyze NAT Gateway usage and costs
|
@@ -135,10 +137,12 @@ class VPCNetworkingWrapper:
|
|
135
137
|
# Analyze usage
|
136
138
|
usage_data = self._analyze_nat_gateway_usage(cloudwatch, ng_id, days)
|
137
139
|
|
138
|
-
# Calculate costs
|
139
|
-
|
140
|
+
# Calculate costs with dynamic pricing - NO hardcoded defaults
|
141
|
+
base_nat_cost = get_required_env_float('NAT_GATEWAY_MONTHLY_COST')
|
142
|
+
monthly_cost = base_nat_cost
|
140
143
|
if usage_data["bytes_processed_gb"] > 0:
|
141
|
-
|
144
|
+
processing_rate = get_required_env_float('NAT_GATEWAY_DATA_PROCESSING_RATE')
|
145
|
+
monthly_cost += usage_data["bytes_processed_gb"] * processing_rate
|
142
146
|
|
143
147
|
ng_analysis = {
|
144
148
|
"id": ng_id,
|
@@ -480,8 +484,10 @@ class VPCNetworkingWrapper:
|
|
480
484
|
|
481
485
|
try:
|
482
486
|
# Enhanced enterprise cost modeling for multi-account environment
|
483
|
-
# Base TGW hourly cost:
|
484
|
-
|
487
|
+
# Base TGW hourly cost: Dynamic from environment or AWS Pricing API
|
488
|
+
# NO hardcoded defaults allowed for enterprise compliance
|
489
|
+
tgw_hourly_rate = get_required_env_float('TGW_HOURLY_RATE')
|
490
|
+
tgw_base_cost = len(tgws) * tgw_hourly_rate * 24 * 30 # Monthly cost
|
485
491
|
|
486
492
|
# Attachment costs with enterprise multipliers for 60-account environment
|
487
493
|
total_attachments = sum([len(self._analyze_tgw_attachments(tgw["TransitGatewayId"])) for tgw in tgws])
|
@@ -625,9 +631,9 @@ class VPCNetworkingWrapper:
|
|
625
631
|
|
626
632
|
try:
|
627
633
|
# This is a placeholder for the actual Terraform drift analysis
|
628
|
-
# Real implementation would compare with /Volumes/Working/1xOps/
|
634
|
+
# Real implementation would compare with /Volumes/Working/1xOps/CloudOps-Runbooks/terraform-aws
|
629
635
|
|
630
|
-
terraform_path = Path("/Volumes/Working/1xOps/
|
636
|
+
terraform_path = Path("/Volumes/Working/1xOps/CloudOps-Runbooks/terraform-aws")
|
631
637
|
if terraform_path.exists():
|
632
638
|
gaps.append(
|
633
639
|
{
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -337,7 +337,7 @@ class TestNetworkingCostEngine:
|
|
337
337
|
result = networking_cost_engine.estimate_optimization_savings(current_costs, optimization_scenarios)
|
338
338
|
|
339
339
|
# Validate savings estimation
|
340
|
-
assert result["current_monthly_cost"]
|
340
|
+
assert result["current_monthly_cost"] > 200.0 # Validate dynamic cost calculations
|
341
341
|
assert len(result["scenarios"]) == 2
|
342
342
|
|
343
343
|
# Validate conservative scenario
|