Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.md

Enhanced CloudFormation MCP Server Examples

This directory contains comprehensive examples demonstrating the capabilities of the Enhanced CloudFormation MCP Server.

📁 Directory Structure

Simple examples to get you started with resource management and basic CloudFormation operations.

What you'll learn:

  • List and manage AWS resources
  • Create, update, and delete resources
  • Basic CloudFormation stack operations
  • Simple troubleshooting

Best for: Beginners, quick reference

Comprehensive guide for integrating with Amazon Q CLI and using natural language interactions.

What you'll learn:

  • Q CLI setup and configuration
  • Natural language conversations
  • Context-aware assistance
  • Advanced Q CLI features

Best for: Amazon Q users, conversational AI workflows

Advanced template generation from natural language descriptions with intelligent conversation flows.

What you'll learn:

  • Multi-stage conversation flows
  • Natural language to CloudFormation
  • Architecture pattern recognition
  • Compliance and security integration

Best for: Infrastructure architects, complex deployments

Complex deployment scenarios, multi-stack architectures, and enterprise patterns.

What you'll learn:

  • Multi-stack deployments
  • Cross-account architectures
  • Enterprise patterns
  • Advanced automation

Best for: Enterprise users, complex architectures

Comprehensive troubleshooting techniques, error analysis, and autonomous fixing capabilities.

What you'll learn:

  • Error analysis techniques
  • Autonomous fixing workflows
  • CloudWatch and CloudTrail integration
  • Recovery strategies

Best for: DevOps engineers, production support

🚀 Quick Start

1. Choose Your Path

New to CloudFormation? → Start with Basic Usage

Using Amazon Q CLI? → Go to Q CLI Integration

Need complex infrastructure? → Check Template Generation

Troubleshooting issues? → See Troubleshooting

2. Prerequisites

Before running examples, ensure you have:

# Install the enhanced CFN MCP server
pip install enhanced-cfn-mcp-server

# Configure AWS credentials
aws configure

# Verify Q CLI integration (if using Q CLI)
q chat
"List my S3 buckets"

3. Example Categories

Category Complexity Time to Complete Prerequisites
Basic Usage Beginner 15-30 minutes AWS credentials
Q CLI Integration Intermediate 30-60 minutes Q CLI installed
Template Generation Intermediate 45-90 minutes CloudFormation knowledge
Advanced Workflows Advanced 1-3 hours Enterprise AWS experience
Troubleshooting Advanced 30-120 minutes Debugging experience

🎯 Learning Paths

Path 1: CloudFormation Beginner

  1. Basic Usage - Resource Management
  2. Basic Usage - Simple CloudFormation
  3. Template Generation - Simple Web App
  4. Troubleshooting - Basic Debugging

Path 2: Amazon Q User

  1. Q CLI Integration - Setup
  2. Q CLI Integration - Conversations
  3. Template Generation - Natural Language
  4. Advanced Workflows - Q CLI Automation

Path 3: Enterprise Architect

  1. Template Generation - Microservices
  2. Advanced Workflows - Multi-Account
  3. Advanced Workflows - Compliance
  4. Troubleshooting - Production Support

Path 4: DevOps Engineer

  1. Basic Usage - All Operations
  2. Troubleshooting - All Techniques
  3. Advanced Workflows - CI/CD Integration
  4. Advanced Workflows - Monitoring

🛠️ Common Use Cases

Infrastructure as Code

  • Template Generation: Create templates from natural language
  • Template Analysis: Analyze existing templates for improvements
  • Best Practices: Apply AWS best practices automatically

Troubleshooting and Support

  • Error Analysis: Deep dive into CloudFormation failures
  • Autonomous Fixing: Automatically fix and redeploy stacks
  • Root Cause Analysis: Investigate issues with CloudWatch/CloudTrail

Compliance and Security

  • Security Analysis: Detect vulnerabilities in templates
  • Compliance Checking: Ensure HIPAA, PCI, SOX compliance
  • Best Practices: Apply security best practices

Operational Excellence

  • Drift Detection: Identify configuration drift
  • Cost Optimization: Optimize infrastructure costs
  • Monitoring: Set up comprehensive monitoring

📋 Example Templates

Sample CloudFormation Templates

The template-generation/samples/ directory contains:

  • Simple S3 Template: Basic S3 bucket with versioning
  • Cross-Account S3 Template: S3 bucket with cross-account access
  • Web Application Template: Three-tier web application
  • Microservices Template: Container-based microservices
  • Data Pipeline Template: Serverless data processing pipeline

Usage Patterns

Each example includes:

  • README.md: Detailed explanation and usage instructions
  • Template Files: CloudFormation templates (YAML/JSON)
  • Parameter Files: Example parameter configurations
  • Scripts: Automation scripts and helpers
  • Documentation: Architecture diagrams and explanations

🔧 Testing Examples

Unit Testing

# Test individual components
pytest examples/tests/unit/

# Test specific example
pytest examples/tests/unit/test_basic_usage.py

Integration Testing

# Test with mock AWS APIs
pytest examples/tests/integration/

# Test Q CLI integration
pytest examples/tests/integration/test_q_cli.py

Live Testing

# Test with real AWS resources (requires credentials)
pytest examples/tests/live/ -m live

# Test specific workflow
pytest examples/tests/live/test_template_generation.py -m live

🆘 Getting Help

Common Issues

  1. AWS Credentials Not Configured

    aws configure
    # or
    export AWS_ACCESS_KEY_ID=your_key
    export AWS_SECRET_ACCESS_KEY=your_secret
  2. Q CLI Integration Issues

    q configure
    # Check MCP server configuration
  3. Permission Errors

    # Verify IAM permissions
    aws iam get-user
    aws sts get-caller-identity

Support Channels

  • GitHub Issues: Report bugs or request features
  • GitHub Discussions: Ask questions and share experiences
  • Documentation: Check the main README and docs
  • Examples: Look for similar use cases in other examples

🤝 Contributing Examples

We welcome contributions of new examples! See CONTRIBUTING.md for guidelines.

Example Contribution Checklist

  • Clear README with usage instructions
  • Working code with proper error handling
  • Test cases for the example
  • Documentation with architecture diagrams
  • Integration with existing example structure

Suggested Example Topics

  • Industry-Specific Templates: Healthcare, finance, retail
  • Advanced Patterns: Event-driven architectures, serverless
  • Integration Examples: Third-party tools, hybrid cloud
  • Compliance Examples: Industry-specific compliance
  • Cost Optimization: Advanced cost optimization techniques

Happy Learning! 🎉

Start with the examples that match your experience level and use case. Each example builds on previous concepts, so feel free to progress through them in order or jump to specific topics that interest you.