{"id":28737556,"url":"https://github.com/naserraoofi/ebs_snapshot_cli_app","last_synced_at":"2025-09-09T12:39:50.124Z","repository":{"id":306403499,"uuid":"1000838221","full_name":"NaserRaoofi/EBS_Snapshot_CLI_APP","owner":"NaserRaoofi","description":"This project provides a command-line interface for managing AWS EC2 snapshots. It allows users to create and restore snapshots of EC2 instances easily.","archived":false,"fork":false,"pushed_at":"2025-07-25T08:54:33.000Z","size":148,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-25T14:29:06.174Z","etag":null,"topics":["aws","devops","featured"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NaserRaoofi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-12T11:56:56.000Z","updated_at":"2025-07-25T08:54:37.000Z","dependencies_parsed_at":"2025-07-25T14:33:08.537Z","dependency_job_id":"635a2466-9502-4f9f-beb0-0a5d66a2abe3","html_url":"https://github.com/NaserRaoofi/EBS_Snapshot_CLI_APP","commit_stats":null,"previous_names":["naserraoofi/ebs_snapshot_cli_app"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/NaserRaoofi/EBS_Snapshot_CLI_APP","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NaserRaoofi%2FEBS_Snapshot_CLI_APP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NaserRaoofi%2FEBS_Snapshot_CLI_APP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NaserRaoofi%2FEBS_Snapshot_CLI_APP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NaserRaoofi%2FEBS_Snapshot_CLI_APP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NaserRaoofi","download_url":"https://codeload.github.com/NaserRaoofi/EBS_Snapshot_CLI_APP/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NaserRaoofi%2FEBS_Snapshot_CLI_APP/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274296569,"owners_count":25258869,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-09T02:00:10.223Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","devops","featured"],"created_at":"2025-06-16T02:42:26.122Z","updated_at":"2025-09-09T12:39:50.114Z","avatar_url":"https://github.com/NaserRaoofi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EBS Snapshot Tool - Clean Architecture\n\nThis project provides a command-line interface for managing AWS EC2 snapshots using Clean Architecture principles with Domain-Driven Design.\n\n## Architecture Overview\n\nThe project follows Clean Architecture with clear separation of concerns:\n\n```\nsrc/\n├── domain/                 # Enterprise Business Rules\n│   ├── entities/          # Domain entities (dataclasses)\n│   ├── repositories/      # Repository interfaces\n│   └── services/          # Domain services\n├── application/           # Application Business Rules\n│   ├── dtos/             # Data Transfer Objects (dataclasses)\n│   ├── use_cases/        # Application use cases\n│   └── validation.py     # Request validation using Pydantic\n├── infrastructure/       # External Interface Adapters\n│   ├── aws/              # AWS SDK implementations\n│   ├── config/           # Configuration with Pydantic models\n│   └── logging/          # Logging infrastructure\n└── presentation/         # User Interface\n    ├── cli/              # Command-line interface\n    └── web/              # Future web interface\n```\n\n## Technology Stack\n\n- **Python 3.10+** with Poetry for dependency management\n- **Dataclasses** for domain entities and DTOs\n- **Pydantic** for configuration validation and request validation\n- **Dependency Injector** for IoC container\n- **Click** for CLI interface\n- **Boto3** for AWS integration\n\n## Installation\n\n1. Clone the repository:\n   ```bash\n   git clone \u003crepository-url\u003e\n   cd EBS_Snapshot_CLI_APP\n   ```\n\n2. Install dependencies using Poetry:\n   ```bash\n   poetry install\n   ```\n\n3. Set up your AWS credentials in the `.env` file:\n   ```\n   AWS_REGION=your_aws_region\n   AWS_PROFILE=your_aws_profile\n   LOG_LEVEL=INFO\n   LOG_FILE=backup.log\n   ```\n\n## Usage\n\nRun the application:\n```bash\npoetry run python -m src.presentation.cli.main\n```\n\nOr use the Poetry script:\n```bash\npoetry run ebs-snapshot\n```\n\n## Features\n\n1. **Take Snapshot** - Create snapshots of EC2 instances with validation\n2. **List Snapshots** - View all snapshots for an instance\n3. **Delete Snapshot** - Remove snapshots with confirmation\n4. **Restore from Snapshot** - Restore instances from snapshots\n\n## Clean Architecture Benefits\n\n- **Testability**: Easy to unit test with mocked dependencies\n- **Maintainability**: Clear separation of concerns\n- **Flexibility**: Easy to add new interfaces (web, API, etc.)\n- **Validation**: Pydantic ensures data integrity at boundaries\n- **Configuration**: Environment-based configuration with validation\n\n## Testing\n\nThis project uses `pytest` and `pytest-mock` for unit and CLI tests. To run all tests:\n\n```bash\npytest\n```\n\n### Test Structure\n- All tests are in the `tests/` directory.\n- `pytest-mock` is used for mocking in pytest style.\n- No real AWS calls are made during tests; all AWS interactions are mocked.\n\n### Example Test Command\n\n```bash\npytest tests/\n```\n\n## Continuous Integration\n\nGitHub Actions will automatically lint and test your code on every push and pull request.\n\n## CI/CD Pipeline Overview\n\nThis project uses GitHub Actions for a robust, multi-stage CI/CD pipeline:\n\n- **Lint:** Checks code style and quality using flake8.\n- **Test:** Runs all unit and integration tests with pytest.\n- **Security \u0026 Quality:** Runs SonarCloud analysis, Bandit, and Gitleaks for code quality and security scanning.\n- **Build:** Builds the Python package (wheel and sdist) and Docker image after all security checks pass.\n- **Deploy:** Pushes the Docker image to AWS ECR only if all previous stages succeed.\n\n### Workflow Chain\n- Lint → Test → Security \u0026 Quality → Build → Deploy\n\n### Key Workflow Files\n- `.github/workflows/python_lint.yml` — Linting\n- `.github/workflows/python_test.yml` — Testing\n- `.github/workflows/security.yml` — Security \u0026 quality checks\n- `.github/workflows/build.yml` — Build package and Docker image\n- `.github/workflows/deploy.yml` — Deploy Docker image to ECR\n\n### Docker \u0026 ECR\n- The Docker image is built from the project wheel and pushed to AWS ECR after all checks pass.\n- See `Dockerfile` for build details.\n\n## Versioning\n\nThis project uses semantic versioning. The current stable release is tagged as `v1.0.0` on GitHub.\n\n## How to Contribute\n\n- Fork the repository\n- Create a feature branch\n- Submit a pull request\n\n## Changelog\n\n- v1.0.0: Initial stable release with full test coverage, CI, and CLI functionality.\n\n## License\n\nThis project is licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaserraoofi%2Febs_snapshot_cli_app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnaserraoofi%2Febs_snapshot_cli_app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaserraoofi%2Febs_snapshot_cli_app/lists"}