The AWS DevOps Agent now includes comprehensive document generation capabilities that automatically create and save reports to a reports/ folder when users request document or report generation.
- Reports Folder: All documents are saved to
reports/directory - Organized Structure: Documents are automatically organized by type
- Multiple Formats: Support for Markdown, JSON, CSV, and Excel formats
- Timestamped Files: Automatic timestamping to prevent overwrites
- Cost Analysis: Detailed cost optimization reports
- Security Compliance: Security and compliance assessment reports
- Infrastructure: IaC analysis and best practices reports
- CDK Analysis: CDK project analysis and optimization reports
- General: Custom documents and reports
reports/
├── cost-analysis/ # Cost optimization reports
├── security-compliance/ # Security and compliance reports
├── infrastructure-as-code/ # IaC analysis reports
├── cdk-analysis/ # CDK project reports
├── compliance-reports/ # Compliance framework reports
├── multi-account/ # Multi-account analysis reports
└── general/ # General purpose reports
Generate and save any type of document.
Parameters:
content: Document content (text, JSON data, or structured data)title: Document titledocument_type: Type of document (general, cost, security, iac, cdk, compliance, multi-account)format: Output format (markdown, json, csv, excel)filename: Custom filename (auto-generated if None)
Example:
result = generate_document(
content={"summary": "Test report", "findings": ["Finding 1", "Finding 2"]},
title="Test Report",
document_type="general",
format="markdown"
)Generate a comprehensive cost analysis document.
Parameters:
cost_data: Cost analysis data from cost toolstitle: Document title (default: "Cost Analysis Report")filename: Custom filename (auto-generated if None)
Generate a comprehensive security compliance document.
Parameters:
security_data: Security analysis data from security toolstitle: Document title (default: "Security Compliance Report")filename: Custom filename (auto-generated if None)
Generate a comprehensive infrastructure analysis document.
Parameters:
iac_data: Infrastructure analysis data from IaC toolstitle: Document title (default: "Infrastructure Analysis Report")filename: Custom filename (auto-generated if None)
Generate a comprehensive CDK analysis document.
Parameters:
cdk_data: CDK analysis data from CDK toolstitle: Document title (default: "CDK Analysis Report")filename: Custom filename (auto-generated if None)
List all generated documents in the reports folder.
Parameters:
document_type: Filter by document type (optional)limit: Maximum number of documents to return (default: 20)
Get information about a specific document.
Parameters:
file_path: Path to the document file
User: "Generate a cost analysis report"
Agent: [Analyzes costs and creates a detailed report in reports/cost-analysis/]
User: "Create a security compliance document for my infrastructure"
Agent: [Analyzes security and creates a compliance report in reports/security-compliance/]
User: "Generate a CDK optimization report for my project"
Agent: [Analyzes CDK project and creates an optimization report in reports/cdk-analysis/]
User: "Show me all the reports I've generated"
Agent: [Lists all documents in the reports folder with details]
- Best for: Human-readable reports, documentation
- Features: Rich formatting, headers, lists, tables
- Metadata: YAML frontmatter with generation info
- Best for: Machine-readable data, API responses
- Features: Structured data, easy to parse
- Metadata: Included in the data structure
- Best for: Tabular data, spreadsheet import
- Features: Comma-separated values, Excel compatible
- Use case: Cost breakdowns, resource lists
- Best for: Complex reports with multiple sheets
- Features: Multiple worksheets, rich formatting
- Use case: Executive reports, detailed analysis
The reports directory can be configured by modifying the ReportGenerator class:
from aws_devops_agent.utils.report_generator import ReportGenerator
# Custom reports directory
report_gen = ReportGenerator(reports_dir="custom_reports")Files are automatically named with timestamps to prevent overwrites:
- Format:
{title}_{YYYYMMDD_HHMMSS}.{extension} - Example:
cost_analysis_20250906_192643.md
---
title: Document Title
generated_at: 2025-09-06T19:26:43.955348
report_type: cost
file_path: reports/cost-analysis/document.md
format: markdown
---
# Document Title
**Generated:** 2025-09-06 19:26:43
## Executive Summary
[Summary content]
## Detailed Analysis
[Analysis content]{
"report_metadata": {
"generated_at": "2025-09-06T19:26:43.955348",
"report_type": "cost",
"file_path": "reports/cost-analysis/document.json",
"format": "json"
},
"report_data": {
"executive_summary": {...},
"detailed_analysis": {...}
}
}The document generation tools are fully integrated with the AWS DevOps Agent:
- Automatic Detection: Agent recognizes document generation requests
- Safe Operation: Document generation is considered safe (no consent required)
- Smart Routing: Agent automatically selects appropriate document type
- Rich Content: Agent populates documents with comprehensive analysis
- Tangible Outputs: Get actual files you can share and review
- Organized Storage: All reports in one place, organized by type
- Multiple Formats: Choose the format that works best for your needs
- Timestamped: Never lose previous reports
- Shareable Reports: Easy to share with stakeholders
- Consistent Format: Standardized report structure
- Version Control: Timestamped files for version tracking
- Integration Ready: JSON/CSV formats for tool integration
# List all documents
make query QUERY="Show me all generated documents"
# List specific type
make query QUERY="List all cost analysis reports"# Get document details
make query QUERY="Get information about reports/cost-analysis/cost_report.md"Test the document generation functionality:
# Run document generation test
python test_document_generation.py
# Run enhanced reports demo
python docs/demos/demo_enhanced_reports.py
# Test with agent
make example-report- Use descriptive titles for better organization
- Let the system auto-generate filenames with timestamps
- Use appropriate document types for better categorization
- Provide structured data for better formatting
- Include executive summaries for quick understanding
- Use consistent terminology across documents
- Regularly review and archive old reports
- Use the listing tools to find specific documents
- Consider the appropriate format for your use case
The document generation feature provides:
- ✅ Automatic file creation in organized
reports/folder - ✅ Multiple formats (Markdown, JSON, CSV, Excel)
- ✅ Type-based organization for easy management
- ✅ Timestamped files to prevent overwrites
- ✅ Rich content with comprehensive analysis
- ✅ Easy integration with existing workflows
- ✅ Safe operation (no consent required)
The agent now creates tangible, shareable documents that you can use for reporting, analysis, and team collaboration! 📄✨