Skill: kaiyuelv/aws-cloud-toolkit (version 1.0.0)

# aws-cloud-toolkit ## Name - **en**: AWS Cloud Toolkit - **zh**: AWS云服务工具包 ## Description - **en**: Comprehensive AWS cloud resource management toolkit supporting EC2, S3, RDS, Lambda operations with automated deployment and monitoring capabilities. - **zh**: 全面的AWS云资源管理工具包，支持EC2、S3、RDS、Lambda操作，具备自动化部署和监控能力。 ## Tools ### EC2 Instance Management **Tool**: `ec2_manager` **Description**: Manage AWS EC2 instances - list, start, stop, create, terminate **Input Schema**: ```json { "action": {"type": "string", "enum": ["list", "start", "stop", "create", "terminate"]}, "instance_id": {"type": "string"}, "instance_type": {"type": "string", "default": "t2.micro"}, "image_id": {"type": "string"}, "key_name": {"type": "string"}, "security_group_ids": {"type": "array", "items": {"type": "string"}}, "region": {"type": "string", "default": "us-east-1"} } ``` **Example**: ```json { "action": "list", "region": "us-east-1" } ``` ### S3 Bucket Operations **Tool**: `s3_manager` **Description**: Manage AWS S3 buckets - create, delete, list, upload, download objects **Input Schema**: ```json { "action": {"type": "string", "enum": ["list_buckets", "create_bucket", "delete_bucket", "list_objects", "upload", "download", "delete_object"]}, "bucket_name": {"type": "string"}, "object_key": {"type": "string"}, "local_path": {"type": "string"}, "region": {"type": "string", "default": "us-east-1"} } ``` **Example**: ```json { "action": "list_buckets", "region": "us-east-1" } ``` ### Lambda Function Management **Tool**: `lambda_manager` **Description**: Deploy and manage AWS Lambda functions **Input Schema**: ```json { "action": {"type": "string", "enum": ["list", "create", "update", "delete", "invoke"]}, "function_name": {"type": "string"}, "runtime": {"type": "string", "default": "python3.9"}, "handler": {"type": "string"}, "role_arn": {"type": "string"}, "code_path": {"type": "string"}, "region": {"type": "string", "default": "us-east-1"} } ``` ### CloudWatch Monitoring **Tool**: `cloudwatch_monitor` **Description**: Monitor AWS resources with CloudWatch metrics and alarms **Input Schema**: ```json { "action": {"type": "string", "enum": ["get_metrics", "create_alarm", "list_alarms", "get_logs"]}, "namespace": {"type": "string"}, "metric_name": {"type": "string"}, "dimensions": {"type": "object"}, "alarm_name": {"type": "string"}, "threshold": {"type": "number"}, "region": {"type": "string", "default": "us-east-1"} } ``` ## Configuration **Environment Variables**: ```bash AWS_ACCESS_KEY_ID=your_access_key AWS_SECRET_ACCESS_KEY=your_secret_key AWS_DEFAULT_REGION=us-east-1 ``` ## Usage Examples ```python from aws_cloud_toolkit import EC2Manager, S3Manager, LambdaManager # EC2 operations ec2 = EC2Manager(region='us-east-1') instances = ec2.list_instances() ec2.start_instance('i-1234567890abcdef0') # S3 operations s3 = S3Manager(region='us-east-1') s3.create_bucket('my-new-bucket') s3.upload_file('my-bucket', 'data.csv', '/local/path/data.csv') # Lambda operations lambda_mgr = LambdaManager(region='us-east-1') lambda_mgr.deploy_function('my-function', 'python3.9', 'handler.lambda_handler') ``` ## Installation ```bash pip install boto3 python-dotenv ``` ## Requirements - Python 3.8+ - AWS Account with appropriate IAM permissions - boto3 library

path: README.md
content: # AWS Cloud Toolkit

<p align="center">
  <strong>🚀 全面的AWS云资源管理工具包 | Comprehensive AWS Cloud Resource Management Toolkit</strong>
</p>

<p align="center">
  <a href="#features">Features</a> •
  <a href="#installation">Installation</a> •
  <a href="#usage">Usage</a> •
  <a href="#api-reference">API</a>
</p>

---

## 🌟 Features

### ☁️ Multi-Service Support
- **EC2** - Instance lifecycle management (create, start, stop, terminate)
- **S3** - Bucket operations and object storage management
- **Lambda** - Serverless function deployment and invocation
- **RDS** - Database instance management
- **CloudWatch** - Metrics monitoring and alarm configuration

### 🔧 Automation Capabilities
- Auto-scaling configuration
- Scheduled backups
- Cost optimization recommendations
- Resource tagging automation

### 📊 Monitoring & Insights
- Real-time resource monitoring
- Cost analysis and forecasting
- Performance metrics dashboard
- Alert notifications

---

## 📦 Installation

```bash
# Install from source
git clone https://github.com/your-org/aws-cloud-toolkit.git
cd aws-cloud-toolkit
pip install -r requirements.txt

# Or install via pip (when published)
pip install aws-cloud-toolkit
```

### Prerequisites
- Python 3.8+
- AWS Account with appropriate IAM permissions
- AWS CLI configured (optional but recommended)

---

## ⚙️ Configuration

### Environment Variables

```bash
export AWS_ACCESS_KEY_ID=your_access_key
export AWS_SECRET_ACCESS_KEY=your_secret_key
export AWS_DEFAULT_REGION=us-east-1
```

### IAM Permissions Required

```json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "ec2:*",
        "s3:*",
        "lambda:*",
        "cloudwatch:*",
        "logs:*"
      ],
      "Resource": "*"
    }
  ]
}
```

---

## 🚀 Usage

### Quick Start

```python
from aws_cloud_toolkit import EC2Manager, S3Manager, LambdaManager

# Initialize managers
ec2 = EC2Manager(region='us-east-1')
s3 = S3Manager(region='us-east-1')
lambda_mgr = LambdaManager(region='us-east-1')

# List all EC2 instances
instances = ec2.list_instances()
for inst in instances:
    print(f"{inst['id']}: {inst['state']} - {inst['type']}")

# Start an instance
ec2.start_instance('i-1234567890abcdef0')

# Create S3 bucket
s3.create_bucket('my-unique-bucket-name')

# Upload file
s3.upload_file('my-unique-bucket-name', 'data/file.csv', '/local/path/file.csv')
```

### EC2 Operations

```python
from aws_cloud_toolkit import EC2Manager

ec2 = EC2Manager(region='us-east-1')

# Create new instance
instance = ec2.create_instance(
    image_id='ami-0c55b159cbfafe1f0',
    instance_type='t2.micro',
    key_name='my-key-pair',
    security_group_ids=['sg-12345678']
)

# Manage instances
ec2.stop_instance('i-1234567890abcdef0')
ec2.start_instance('i-1234567890abcdef0')
ec2.terminate_instance('i-1234567890abcdef0')
```

### S3 Operations

```python
from aws_cloud_toolkit import S3Manager

s3 = S3Manager(region='us-east-1')

# Bucket operations
buckets = s3.list_buckets()
s3.create_bucket('my-new-bucket')
s3.delete_bucket('old-bucket')

# Object operations
s3.upload_file('my-bucket', 'path/in/bucket/file.txt', '/local/file.txt')
s3.download_file('my-bucket', 'path/in/bucket/file.txt', '/local/download.txt')
s3.delete_object('my-bucket', 'path/in/bucket/file.txt')

# List objects
objects = s3.list_objects('my-bucket', prefix='data/')
```

### Lambda Operations

```python
from aws_cloud_toolkit import LambdaManager

lambda_mgr = LambdaManager(region='us-east-1')

# Deploy function
lambda_mgr.create_function(
    function_name='my-function',
    runtime='python3.9',
    handler='lambda_function.handler',
    role_arn='arn:aws:iam::123456789012:role/lambda-role',
    code_path='/path/to/function.zip'
)

# Invoke function
result = lambda_mgr.invoke_function('my-function', payload={'key': 'value'})

# Update function
lambda_mgr.update_function_code('my-function', '/path/to/new-code.zip')
```

---

## 📚 API Reference

### EC2Manager

| Method | Description | Parameters |
|--------|-------------|------------|
| `list_instances()` | List all EC2 instances | filters (optional) |
| `create_instance()` | Launch new instance | image_id, instance_type, key_name, ... |
| `start_instance()` | Start stopped instance | instance_id |
| `stop_instance()` | Stop running instance | instance_id |
| `terminate_instance()` | Terminate instance | instance_id |

### S3Manager

| Method | Description | Parameters |
|--------|-------------|------------|
| `list_buckets()` | List all buckets | - |
| `create_bucket()` | Create new bucket | bucket_name, region |
| `delete_bucket()` | Delete empty bucket | bucket_name |
| `upload_file()` | Upload file to bucket | bucket, key, local_path |
| `download_file()` | Download file from bucket | bucket, key, local_path |

### LambdaManager

| Method | Description | Parameters |
|--------|-------------|------------|
| `list_functions()` | List all Lambda functions | - |
| `create_function()` | Create new function | function_name, runtime, handler, ... |
| `invoke_function()` | Invoke function | function_name, payload |
| `update_function()` | Update function code | function_name, code_path |

---

## 🧪 Testing

```bash
# Run all tests
python -m pytest tests/

# Run with coverage
python -m pytest tests/ --cov=aws_cloud_toolkit --cov-report=html
```

---

## 🤝 Contributing

Contributions are welcome! Please read our [Contributing Guide](CONTRIBUTING.md) for details.

---

## 📄 License

MIT License - see [LICENSE](LICENSE) file for details.

---

<p align="center">
  Made with ❤️ for the AWS community
</p>


path: requirements.txt
content: # AWS Cloud Toolkit - Dependencies
boto3>=1.28.0
botocore>=1.31.0
python-dotenv>=1.0.0
click>=8.0.0
pyyaml>=6.0

# Testing
pytest>=7.0.0
pytest-cov>=4.0.0
pytest-asyncio>=0.21.0
moto>=4.0.0

# Development
black>=23.0.0
flake8>=6.0.0
mypy>=1.0.0


Security scan verdicts — ClawScan: suspicious | static analysis: clean | VirusTotal: clean | SkillSpector: suspicious (MEDIUM)