Skip to main content

InfraDrone 🚀

InfraDrone is a robust infrastructure automation tool designed to simplify the deployment and management of cloud resources, Docker containers, and SSH configurations. With support for multiple cloud providers and a user-friendly terminal interface, InfraDrone empowers developers and DevOps engineers to streamline their workflows.


Features ✨

  • Cloud Infrastructure Deployment:

    • Supports Yandex Cloud and Google Cloud Platform (GCP).
    • Automates VM creation with Terraform templates.
    • Configures SSH access for deployed instances.
  • Docker Management:

    • Deploys Docker containers with pre-configured templates.
    • Includes support for Keycloak and PostgreSQL.
  • SSH Configuration:

    • Manages SSH keys and connections.
    • Automatically updates ssh.json for easy access.
  • Extensible Architecture:

    • Easily add new cloud providers or Docker templates.
    • Modular design for custom workflows.

Project Structure 📂

infradrone/
├── config.py               # Configuration loader and saver
├── deploy.py               # Terminal-based deployment menu
├── infra_operations.py     # Core infrastructure deployment logic
├── menus/                  # Terminal UI menus
│   ├── main_menu.py        # Main menu for navigation
│   ├── ssh_connections.py  # SSH connection management
│   └── deploy_docker.py    # Docker deployment menu
├── tf/                     # Terraform templates for cloud providers
│   ├── gcp/                # GCP-specific templates
│   └── yc/                 # Yandex Cloud-specific templates
├── docker/                 # Docker templates
│   └── ubuntu/keycloak/    # Keycloak Docker setup
├── sh/                     # Shell scripts for installation and helpers
├── utils.py                # Utility functions
├── main.py                 # Entry point for the application
├── requirements.txt        # Python dependencies
├── README.md               # Project documentation
└── config.ini              # Configuration file

Installation 🛠️

Prerequisites

  • Python 3.10+
  • Terraform 0.13+
  • Docker and Docker Compose
  • Cloud provider credentials (e.g., GCP or Yandex Cloud)

Steps

  1. Clone the repository:

    git clone https://github.com/HMCorp-Fund/infradrone/infradrone.git
    cd infradrone
    
  2. Install dependencies:

    pip install -r requirements.txt
    
  3. Configure the project:

    • Edit config.ini to set the BaseDirectory:
      [Paths]
      BaseDirectory = %%USERPROFILE%%\infradrone
      
    • Add your cloud provider credentials to config.json.
  4. Run the application:

    python main.py
    

Configuration 📄

Before using InfraDrone, you need to configure the project by editing the config.json file and ensuring the required keys are in place.

1. Configuring config.json

The config.json file contains essential settings for InfraDrone, including SSH credentials, working directories, and cloud provider configurations. Below is an explanation of the key fields:

Example config.json:

{
    "DEFAULT_SSH_PASSWORD": "admin",
    "DEFAULT_SSH_USER": "admin",
    "WORKING_DIR": "C:\\users\\user\\infradrone\\working_dir",
    "KNOWN_HOSTS_DIR": "~\\.ssh\\known_hosts",
    "SSH_PROVIDER": "gcp",

    "PROVIDERS": {
        "yc": {
            "YC_TOKEN": "your-yandex-cloud-token",
            "YC_CLOUD_ID": "your-cloud-id",
            "YC_FOLDER_ID": "your-folder-id",
            "YC_CLOUD_PREFIX": "your-cloud-prefix",
            "YC_ZONE": "your-zone"
        },
        "gcp": {
            "GCP_CREDENTIALS_FILE": "C:\\users\\user\\infradrone\\keys\\your-gcp-credentials.json",
            "GCP_PROJECT_ID": "your-gcp-project-id",
            "GCP_ZONE": "your-gcp-zone",
            "GCP_VM_ZONE": "your-gcp-vm-zone",
            "GCP_NETWORK": "default",
            "GCP_SUBNET": "default",
            "GCP_SSH_KEY": "C:\\users\\user\\infradrone\\keys\\gcp",
            "GCP_SSH_KEY_PASS": "your-ssh-key-password",
            "GCP_SSH_USER": "your-ssh-username"
        }
    }
}

Key Fields:

  • DEFAULT_SSH_USER and DEFAULT_SSH_PASSWORD:
    • Default SSH credentials for connecting to instances.
  • WORKING_DIR:
    • Directory where temporary files and logs will be stored.
  • KNOWN_HOSTS_DIR:
    • Path to the SSH known_hosts file.
  • SSH_PROVIDER:
    • The default cloud provider (gcp or yc).
  • PROVIDERS:
    • Contains provider-specific configurations:
      • Yandex Cloud (yc):
        • YC_TOKEN: Yandex Cloud API token.
        • YC_CLOUD_ID and YC_FOLDER_ID: IDs for your Yandex Cloud project.
        • YC_ZONE: The zone where instances will be deployed.
      • Google Cloud Platform (gcp):
        • GCP_CREDENTIALS_FILE: Path to your GCP service account JSON key.
        • GCP_PROJECT_ID: Your GCP project ID.
        • GCP_ZONE and GCP_VM_ZONE: Zones for deploying instances.
        • GCP_SSH_KEY: Path to your SSH private key for GCP.
        • GCP_SSH_USER: Username for SSH connections.

2. Creating an SSH Key

Before deploying infrastructure, you must create an SSH key pair for secure access to your instances.

Steps to Create an SSH Key:

  1. Open a terminal or PowerShell.
  2. Run the following command to generate an SSH key pair:
    ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
    
  3. Save the key to the specified path (e.g., C:\users\user\infradrone\keys\gcp).
  4. Add the public key to your cloud provider's metadata:
    • Google Cloud: Add the public key to the "SSH Keys" section in the GCP console.
    • Yandex Cloud: Add the public key to the "SSH Keys" section in the Yandex Cloud console.

3. Creating a Google Cloud Key

To use InfraDrone with Google Cloud, you need a service account key for authentication.

Steps to Create a GCP Service Account Key:

  1. Go to the Google Cloud Console.
  2. Navigate to IAM & Admin > Service Accounts.
  3. Create a new service account or select an existing one.
  4. Assign the necessary roles (e.g., Compute Admin and Storage Admin).
  5. Generate a JSON key for the service account:
    • Click Manage Keys > Add Key > Create New Key.
    • Save the JSON key to C:\users\user\infradrone\keys\your-gcp-credentials.json.
  6. Update the GCP_CREDENTIALS_FILE field in config.json with the path to this key.

Usage 🚀

Main Menu

Navigate through the terminal-based menu to deploy infrastructure, manage Docker containers, or configure SSH connections.

Deploying Cloud Infrastructure

  1. Select a cloud provider (e.g., Yandex Cloud or GCP).
  2. Choose an OS and a template.
  3. Provide instance details (e.g., name, allowed ports).
  4. InfraDrone will deploy the instance and configure SSH access.

Managing Docker Containers

  1. Select a Docker OS and template.
  2. InfraDrone will deploy the container using docker-compose.

SSH Configuration

  • View, add, or delete SSH connections directly from the menu.

License 📜

This project is licensed under the MIT License. See the LICENSE file for details.


Happy automating! 🎉

Metadata

Release files for infradrone 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for infradrone 0.1.1
File Size Uploaded Provenance Actions
infradrone-0.1.1.tar.gz 15.6 kB Without provenance Details for infradrone-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for infradrone 0.1.1
File Interpreter ABI Platform Actions
infradrone-0.1.1-py3-none-any.whl Python 3 none any Details for infradrone-0.1.1-py3-none-any.whl

Total release size: 33.2 kB

Release files / infradrone-0.1.1.tar.gz

Download URL infradrone-0.1.1.tar.gz
Size 15.6 kB
Tags Source
SHA-256 checksum
How to use checksums
a9f0160462442966da82e31effec52690d466f0c7a3a0c46da95a12b1d41abdd
BLAKE2b-256 checksum
How to use checksums
2a01efcc131498eac9e16295394c2e5ac3d061977cfcc8396f068e86bf9577a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release files / infradrone-0.1.1-py3-none-any.whl

Download URL infradrone-0.1.1-py3-none-any.whl
Size 17.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
324993fe9632e975c84f6eb80769f7336e1a2e481591845178ce92ff33cbcac6
BLAKE2b-256 checksum
How to use checksums
d99957b6e195c338f75a2e55ab039721d871be2e2b04e9121afdd6cdf3e30e0e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Security for infradrone 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page