@@ -291,7 +291,7 @@ def generate_deployment_summary(deployment_results, stack_prefix, template_url):
291291
292292 # Create prompt for Bedrock with actual logs
293293 prompt = dedent (f"""
294- You are an AWS deployment analyst. Analyze the following deployment logs and create a comprehensive summary.
294+ You are an AWS deployment analyst. Analyze the following deployment logs and create a concise summary in table format .
295295
296296 Deployment Information:
297297 - Timestamp: { datetime .now ().isoformat ()}
@@ -305,14 +305,36 @@ def generate_deployment_summary(deployment_results, stack_prefix, template_url):
305305 Pattern Results Summary:
306306 { json .dumps (deployment_results , indent = 2 )}
307307
308- Please provide:
309- 1. Executive Summary (2-3 sentences)
310- 2. Deployment Status Overview
311- 3. Pattern-by-Pattern Analysis
312- 4. Failure Analysis (extract specific errors from logs)
313- 5. Recommendations based on log analysis
314-
315- Focus on extracting failure reasons from the actual logs and provide actionable insights.
308+ Create a summary with this EXACT format:
309+
310+ ┌─────────────────────────────────────────────────────────────────────────────┐
311+ │ DEPLOYMENT RESULTS │
312+ ├─────────────────────────────────────────────────────────────────────────────┤
313+ │ Pattern │ Status │ Duration │ Key Metrics │
314+ ├─────────────────────────────────────────────────────────────────────────────┤
315+ │ Pattern 1 - BDA │ SUCCESS │ 15m 30s │ 28 functions validated │
316+ │ Pattern 2 - OCR │ SUCCESS │ 12m 45s │ All tests passed │
317+ ├─────────────────────────────────────────────────────────────────────────────┤
318+ │ ROOT CAUSE ANALYSIS │
319+ ├─────────────────────────────────────────────────────────────────────────────┤
320+ │ • CloudWatch log cleanup failed due to concatenated log group names │
321+ │ • AWS CLI text output parsing caused parameter validation errors │
322+ │ • Provide specific error messages, resource names, and failure points │
323+ ├─────────────────────────────────────────────────────────────────────────────┤
324+ │ RECOMMENDATIONS │
325+ ├─────────────────────────────────────────────────────────────────────────────┤
326+ │ • Fix CloudWatch log cleanup to use JSON output instead of text │
327+ │ • Add proper error handling for resource cleanup operations │
328+ └─────────────────────────────────────────────────────────────────────────────┘
329+
330+ Requirements:
331+ - Use EXACT table format above
332+ - For failures: provide detailed root cause analysis for ALL failed patterns
333+ - Include specific error messages, resource names, and exact failure points from logs
334+ - Include sufficient technical details to understand WHY each pattern failed
335+ - Maximum 2-3 bullet points for recommendations
336+ - Keep each line under 75 characters
337+ - Extract actual error messages and resource identifiers from logs
316338 """ )
317339
318340 # Call Bedrock API
@@ -334,10 +356,23 @@ def generate_deployment_summary(deployment_results, stack_prefix, template_url):
334356 response_body = json .loads (response ['body' ].read ())
335357 summary = response_body ['content' ][0 ]['text' ]
336358
337- print ("📊 Deployment Summary Generated:" )
338- print ("=" * 80 )
339- print (summary )
340- print ("=" * 80 )
359+ try :
360+ from rich .console import Console
361+ from rich .panel import Panel
362+
363+ console = Console ()
364+ console .print (Panel (
365+ summary ,
366+ title = "🤖 AI Deployment Analysis" ,
367+ border_style = "green" ,
368+ padding = (1 , 2 )
369+ ))
370+ except ImportError :
371+ # Fallback to plain text if Rich not available
372+ print ("📊 Deployment Summary Generated:" )
373+ print ("=" * 80 )
374+ print (summary )
375+ print ("=" * 80 )
341376
342377 return summary
343378
0 commit comments