A powerful tool for restoring EC2 instances from AMIs
Project description
EC2 Restore Tool
A powerful command-line tool for restoring EC2 instances from AMIs with advanced features and detailed reporting.
Features
- Full Instance Restore: Create a new instance from an AMI while preserving network configuration
- Volume-Level Restore: Restore specific volumes from an AMI to an existing instance
- Detailed Progress Tracking: Real-time progress updates with rich console output
- Comprehensive Reporting: Generate detailed restoration reports
- Network Configuration Preservation: Maintain private IP addresses and network settings
- Systems Manager Integration: Execute post-restore commands using AWS Systems Manager
- Instance Metadata Backup: Automatic backup of instance metadata before restoration
- Volume Change Visualization: Clear display of volume changes before and after restoration
- Instance Change Tracking: Detailed comparison of instance configurations
- Error Handling & Rollback: Robust error handling with automatic rollback capabilities
Installation
pip install ec2-restore
Configuration
Create a config.yaml file in your working directory:
aws:
profile: default
region: us-east-1
restore:
max_amis: 5
backup_metadata: true
log_level: INFO
log_file: ec2_restore.log
ssm:
enabled: true
commands:
- command: "echo 'Test command executed'"
timeout: 30
wait_for_completion: true
document_name: AWS-RunShellScript
output_s3_bucket: ""
output_s3_prefix: ""
Usage
Full Instance Restore
# Restore by instance ID
ec2-restore restore --instance-id i-1234567890abcdef0
# Restore by instance name
ec2-restore restore --instance-name my-instance
# Restore multiple instances
ec2-restore restore --instance-ids i-1234567890abcdef0,i-0987654321fedcba0
Volume Restore
# Restore specific volumes
ec2-restore restore --instance-id i-1234567890abcdef0 --restore-type volume
Options
--instance-id: EC2 instance ID to restore--instance-name: EC2 instance name (tag) to restore--instance-ids: Comma-separated list of EC2 instance IDs to restore--restore-type: Type of restore (full or volume)--config: Path to configuration file (default: config.yaml)
Development
- Clone the repository:
git clone https://github.com/jyothishkshatri/ec2-restore.git
cd ec2-restore
- Create a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install development dependencies:
pip install -e ".[dev]"
License
This project is licensed under the MIT License - see the LICENSE file for details.
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
ec2_restore-1.0.3.tar.gz
(27.7 kB
view details)
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 ec2_restore-1.0.3.tar.gz.
File metadata
- Download URL: ec2_restore-1.0.3.tar.gz
- Upload date:
- Size: 27.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
071d1de6dc58b4b3e261793c8f2428d229fd0601973cbefe0d3a2307ab7af439
|
|
| MD5 |
aba6fe625c67b770e0673d18382b92fd
|
|
| BLAKE2b-256 |
02a171a000a7d84a2e85b259e4b56bc8fbc16b2beec70527c4fdadfa189b1f10
|
File details
Details for the file ec2_restore-1.0.3-py3-none-any.whl.
File metadata
- Download URL: ec2_restore-1.0.3-py3-none-any.whl
- Upload date:
- Size: 28.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
006e4da2c06594df9d8349234b28536bf2477c4ac50203104b359a51b5fd0669
|
|
| MD5 |
d73fe112083f2baf52a870126ab4a908
|
|
| BLAKE2b-256 |
b5506ffce0346cdf949f47d301b37745e5faf06839aa25c060e3bfd9c700a2e5
|