Automate your backup and restores with one config file.
Project description
sumi
sumi is a CLI tool that allows you to setup production-grade backups and disaster recovery one config file. Currently, it supports AWS RDS instances and Aurora clusters.
Features
- Automated RDS snapshots: Parallel execution with status tracking
- Tag-based discovery: Find resources automatically using AWS tags with AND/OR logic
- Config-as-code: Version your DR plan in Git alongside your app
- Data stays in your account: No third-party storage or agents
Installation
From PyPI (Recommended)
pip install sumi
From Source (Development Version)
pip install git+https://github.com/obakengdevelops/sumi.git
Using uv
uv pip install sumi
Quick Start
1. Create a Configuration File
# backup-config.yaml
app: my-app
provider:
name: aws
region: us-east-1
auth:
profile: my-aws-profile
# OR use role_arn: arn:aws:iam::123456789012:role/BackupRole
backup:
resources:
- type: rds
name: production-databases
discover: "tag:Environment=production"
- type: rds
name: staging-databases
discover: "tag:Environment=staging"
2. Validate Configuration
# Validate config structure
sumi validate --config backup-config.yaml
# Validate config AND test AWS credentials
sumi validate --config backup-config.yaml --auth
3. Preview Resources
# See what will be backed up (dry-run)
sumi plan --config backup-config.yaml
4. Execute Backup
# Run backup with 3 parallel snapshots
sumi backup --config backup-config.yaml --parallel 3
Tag Filter Examples
Simple tag:
discover: "tag:Environment=production"
AND condition (all tags must match):
discover: "tag:Environment=production AND tag:Backup=required"
OR condition (any condition can match):
discover: "tag:Environment=production OR tag:Critical=yes"
Complex filters:
discover: "tag:Env=prod AND tag:Backup=true OR tag:Critical=yes"
Commands
validate
Validate your configuration file structure and optionally test AWS credentials.
sumi validate --config <file> # Validate config structure
sumi validate --config <file> --auth # Also test AWS credentials
plan
Preview all resources that will be backed up without making any changes.
sumi plan --config <file>
backup
Execute backups for all configured resources.
sumi backup --config <file> --parallel 3 # Run 3 backups in parallel
Configuration Reference
Required Fields
app: string # Application name
provider:
name: "aws" # Currently only AWS supported
region: string # AWS region (e.g., us-east-1)
auth:
profile: string # AWS profile name
# OR
role_arn: string # IAM role ARN to assume
backup:
resources:
- type: "rds" # Resource type (currently only rds)
name: string # Friendly name for this resource group
discover: string # Tag filter for resource discovery
Tag Filter Syntax
- Single tag:
tag:Key=Value - AND operator:
tag:Key1=Value1 AND tag:Key2=Value2 - OR operator:
tag:Key1=Value1 OR tag:Key2=Value2 - Combined:
tag:K1=V1 AND tag:K2=V2 OR tag:K3=V3
Development
Setup
# Clone repository
git clone https://github.com/obakengdevelops/sumi.git
cd sumi
# Install with uv
uv sync
# Install in development mode
pip install -e .
Running Tests
# Run all tests
pytest
# Run with coverage
pytest --cov=cli --cov-report=html
# Run specific test file
pytest cli/tests/unit/test_config.py -v
Code Quality
# Lint code
ruff check
# Format code
ruff format
# Type check
mypy cli/
# Security scan
bandit -r cli/ -ll
Requirements
- Python >= 3.13
- AWS credentials configured (via
aws configureor IAM role) - IAM permissions for:
rds:DescribeDBInstancesrds:DescribeDBClustersrds:CreateDBClusterSnapshotrds:DescribeDBClusterSnapshotsrds:ListTagsForResource
Roadmap
- RDS Instances
- Aurora Clusters
- Tag-based discovery with AND/OR logic
- Parallel backup execution
- CI/CD pipeline with tests
- Restore command
- EBS volumes
- DynamoDB tables
- S3 bucket versioning
- Multi-region support
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT License - see LICENSE file for details.
Support
For issues, questions, or contributions, please open an issue on GitHub.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sumi-0.1.1.tar.gz.
File metadata
- Download URL: sumi-0.1.1.tar.gz
- Upload date:
- Size: 69.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d4f89eeae7170d4fe19ef06e7faa8407a830453a8934956e007961703a0141b0
|
|
| MD5 |
526c1afe123423bb703bf05dad059276
|
|
| BLAKE2b-256 |
49b913181973f3d0172e1f0f60a5d637933c743f1d93b13872946e7d46b49d2e
|
File details
Details for the file sumi-0.1.1-py3-none-any.whl.
File metadata
- Download URL: sumi-0.1.1-py3-none-any.whl
- Upload date:
- Size: 29.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2635fef6b4e66883871aa7ff16165798095b315818cd82213328b97378aff9bf
|
|
| MD5 |
6a21e060ef4a391c0859b6a7f263c9d8
|
|
| BLAKE2b-256 |
e565e66d2ac8f03ff1299ba1432fcc991b6939a35700a61dc4269dcc2baf463b
|