runbooks 0.7.5__py3-none-any.whl → 0.7.7__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/base.py +5 -1
- runbooks/cfat/__init__.py +2 -2
- runbooks/cfat/assessment/compliance.py +847 -0
- runbooks/finops/__init__.py +1 -1
- runbooks/finops/cli.py +63 -1
- runbooks/finops/dashboard_runner.py +632 -161
- runbooks/finops/helpers.py +492 -61
- runbooks/finops/optimizer.py +822 -0
- runbooks/inventory/collectors/aws_comprehensive.py +435 -0
- runbooks/inventory/discovery.md +1 -1
- runbooks/main.py +158 -12
- runbooks/operate/__init__.py +2 -2
- runbooks/remediation/__init__.py +2 -2
- runbooks/remediation/acm_remediation.py +1 -1
- runbooks/remediation/base.py +1 -1
- runbooks/remediation/cloudtrail_remediation.py +1 -1
- runbooks/remediation/cognito_remediation.py +1 -1
- runbooks/remediation/dynamodb_remediation.py +1 -1
- runbooks/remediation/ec2_remediation.py +1 -1
- runbooks/remediation/ec2_unattached_ebs_volumes.py +1 -1
- runbooks/remediation/kms_enable_key_rotation.py +1 -1
- runbooks/remediation/kms_remediation.py +1 -1
- runbooks/remediation/lambda_remediation.py +1 -1
- runbooks/remediation/multi_account.py +1 -1
- runbooks/remediation/rds_remediation.py +1 -1
- runbooks/remediation/requirements.txt +2 -2
- runbooks/remediation/s3_block_public_access.py +1 -1
- runbooks/remediation/s3_enable_access_logging.py +1 -1
- runbooks/remediation/s3_encryption.py +1 -1
- runbooks/remediation/s3_remediation.py +1 -1
- runbooks/security/__init__.py +1 -1
- {runbooks-0.7.5.dist-info → runbooks-0.7.7.dist-info}/METADATA +4 -2
- {runbooks-0.7.5.dist-info → runbooks-0.7.7.dist-info}/RECORD +50 -67
- {runbooks-0.7.5.dist-info → runbooks-0.7.7.dist-info}/top_level.txt +0 -1
- jupyter-agent/.env +0 -2
- jupyter-agent/.env.template +0 -2
- jupyter-agent/.gitattributes +0 -35
- jupyter-agent/.gradio/certificate.pem +0 -31
- jupyter-agent/README.md +0 -16
- jupyter-agent/__main__.log +0 -8
- jupyter-agent/app.py +0 -256
- jupyter-agent/cloudops-agent.png +0 -0
- jupyter-agent/ds-system-prompt.txt +0 -154
- jupyter-agent/jupyter-agent.png +0 -0
- jupyter-agent/llama3_template.jinja +0 -123
- jupyter-agent/requirements.txt +0 -9
- jupyter-agent/tmp/4ojbs8a02ir/jupyter-agent.ipynb +0 -68
- jupyter-agent/tmp/cm5iasgpm3p/jupyter-agent.ipynb +0 -91
- jupyter-agent/tmp/crqbsseag5/jupyter-agent.ipynb +0 -91
- jupyter-agent/tmp/hohanq1u097/jupyter-agent.ipynb +0 -57
- jupyter-agent/tmp/jns1sam29wm/jupyter-agent.ipynb +0 -53
- jupyter-agent/tmp/jupyter-agent.ipynb +0 -27
- jupyter-agent/utils.py +0 -409
- runbooks/inventory/aws_organization.png +0 -0
- /runbooks/inventory/{tests → Tests}/common_test_data.py +0 -0
- /runbooks/inventory/{tests → Tests}/common_test_functions.py +0 -0
- /runbooks/inventory/{tests → Tests}/script_test_data.py +0 -0
- /runbooks/inventory/{tests → Tests}/setup.py +0 -0
- /runbooks/inventory/{tests → Tests}/src.py +0 -0
- /runbooks/inventory/{tests/test_inventory_modules.py → Tests/test_Inventory_Modules.py} +0 -0
- /runbooks/inventory/{tests → Tests}/test_cfn_describe_stacks.py +0 -0
- /runbooks/inventory/{tests → Tests}/test_ec2_describe_instances.py +0 -0
- /runbooks/inventory/{tests → Tests}/test_lambda_list_functions.py +0 -0
- /runbooks/inventory/{tests → Tests}/test_moto_integration_example.py +0 -0
- /runbooks/inventory/{tests → Tests}/test_org_list_accounts.py +0 -0
- /runbooks/inventory/{Inventory_Modules.py → inventory_modules.py} +0 -0
- {runbooks-0.7.5.dist-info → runbooks-0.7.7.dist-info}/WHEEL +0 -0
- {runbooks-0.7.5.dist-info → runbooks-0.7.7.dist-info}/entry_points.txt +0 -0
- {runbooks-0.7.5.dist-info → runbooks-0.7.7.dist-info}/licenses/LICENSE +0 -0
runbooks/finops/__init__.py
CHANGED
@@ -12,7 +12,7 @@ This module provides terminal-based AWS cost monitoring with features including:
|
|
12
12
|
Integrated as a submodule of CloudOps Runbooks for enterprise FinOps automation.
|
13
13
|
"""
|
14
14
|
|
15
|
-
__version__ = "0.7.
|
15
|
+
__version__ = "0.7.6"
|
16
16
|
|
17
17
|
# Core components
|
18
18
|
# AWS client utilities
|
runbooks/finops/cli.py
CHANGED
@@ -10,7 +10,7 @@ from runbooks.finops.helpers import load_config_file
|
|
10
10
|
|
11
11
|
console = Console()
|
12
12
|
|
13
|
-
__version__ = "0.7.
|
13
|
+
__version__ = "0.7.6"
|
14
14
|
|
15
15
|
|
16
16
|
def welcome_banner() -> None:
|
@@ -128,6 +128,22 @@ def main() -> int:
|
|
128
128
|
action="store_true",
|
129
129
|
help="Display an audit report with cost anomalies, stopped EC2 instances, unused EBS columes, budget alerts, and more",
|
130
130
|
)
|
131
|
+
parser.add_argument(
|
132
|
+
"--pdca",
|
133
|
+
action="store_true",
|
134
|
+
help="Run autonomous PDCA (Plan-Do-Check-Act) cycles for continuous improvement",
|
135
|
+
)
|
136
|
+
parser.add_argument(
|
137
|
+
"--pdca-cycles",
|
138
|
+
help="Number of PDCA cycles to run (default: 3, 0 for continuous mode)",
|
139
|
+
type=int,
|
140
|
+
default=3,
|
141
|
+
)
|
142
|
+
parser.add_argument(
|
143
|
+
"--pdca-continuous",
|
144
|
+
action="store_true",
|
145
|
+
help="Run PDCA in continuous mode (until manually stopped)",
|
146
|
+
)
|
131
147
|
|
132
148
|
args = parser.parse_args()
|
133
149
|
|
@@ -143,6 +159,52 @@ def main() -> int:
|
|
143
159
|
if hasattr(args, key) and getattr(args, key) == parser.get_default(key):
|
144
160
|
setattr(args, key, value)
|
145
161
|
|
162
|
+
# Handle PDCA mode
|
163
|
+
if args.pdca or args.pdca_continuous:
|
164
|
+
import asyncio
|
165
|
+
from runbooks.finops.pdca_engine import AutonomousPDCAEngine, PDCAThresholds
|
166
|
+
|
167
|
+
console.print("[bold bright_cyan]🤖 Launching Autonomous PDCA Engine...[/]")
|
168
|
+
|
169
|
+
# Configure PDCA thresholds
|
170
|
+
thresholds = PDCAThresholds(
|
171
|
+
max_risk_score=25,
|
172
|
+
max_cost_increase=10.0,
|
173
|
+
max_untagged_resources=50,
|
174
|
+
max_unused_eips=5,
|
175
|
+
max_budget_overruns=1
|
176
|
+
)
|
177
|
+
|
178
|
+
# Initialize PDCA engine
|
179
|
+
artifacts_dir = args.dir or "artifacts"
|
180
|
+
engine = AutonomousPDCAEngine(thresholds=thresholds, artifacts_dir=artifacts_dir)
|
181
|
+
|
182
|
+
try:
|
183
|
+
# Determine execution mode
|
184
|
+
continuous_mode = args.pdca_continuous
|
185
|
+
max_cycles = 0 if continuous_mode else args.pdca_cycles
|
186
|
+
|
187
|
+
# Run PDCA cycles
|
188
|
+
metrics_history = asyncio.run(engine.run_autonomous_cycles(max_cycles, continuous_mode))
|
189
|
+
|
190
|
+
# Generate summary report
|
191
|
+
engine.generate_cycle_summary_report()
|
192
|
+
|
193
|
+
console.print(f"\n[bold bright_green]🎉 PDCA Engine completed successfully![/]")
|
194
|
+
console.print(f"[cyan]Generated {len(metrics_history)} cycle reports in: {engine.pdca_dir}[/]")
|
195
|
+
|
196
|
+
return 0
|
197
|
+
|
198
|
+
except KeyboardInterrupt:
|
199
|
+
console.print(f"\n[yellow]⏸️ PDCA Engine stopped by user[/]")
|
200
|
+
if engine.cycle_history:
|
201
|
+
engine.generate_cycle_summary_report()
|
202
|
+
return 0
|
203
|
+
except Exception as e:
|
204
|
+
console.print(f"\n[red]❌ PDCA Engine failed: {str(e)}[/]")
|
205
|
+
return 1
|
206
|
+
|
207
|
+
# Default dashboard mode
|
146
208
|
result = run_dashboard(args)
|
147
209
|
return 0 if result == 0 else 1
|
148
210
|
|