Read infrastructure data from your cloud and export it to a SQL database.
Project description
cloud2sql
Read infrastructure data from your cloud and export it to a SQL database.
Installation
Python 3.9 or higher is required. It is recommended to use a separate virtual environment for this project. You can create one with the following command:
python3 -m venv venv --prompt "cloud2sql"
source venv/bin/activate
Once the virtual environment is activated, you can install cloud2sql:
pip install cloud2sql
Usage
The sources for cloud2sql
are configured via a configuration file. Create your own configuration by adjusting the config template file.
You can safely delete the sections that are not relevant to you (e.g. if you do not use AWS, you can delete the aws
section).
All sections refer to cloud providers and are enabled if a configuration section is provided.
After the sources are configured, you need to define the url to the database. The following databases are currently supported:
SQLite
sqlite:///path/to/resoto.db
PostgreSQL
postgresql://user:password@host:port/dbname[?key=value&key=value...]
MySQL
mysql://username:password@host/dbname[?key=value&key=value...]
MariaDB
mariadb://username:password@host/dbname[?key=value&key=value...]
My database is not listed here
cloud2sql uses SQLAlchemy to connect to the database. If your database is not listed here, you can check if it is supported in SQLAlchemy Dialects. Install the relevant driver and use the connection string from the documentation.
Example
We use a minimal configuration example and export the data to a SQLite database. The example uses our AWS default credentials and the default kubernetes config.
cloud2sql --config config-example.yaml --db "sqlite:///resoto.db"
Local Development
Create a local development environment with the following command:
make setup
source venv/bin/activate
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
Hashes for cloud2sql-0.5.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 47648a300501a08ed0cf47e4b33857f7c36cebe6765c46525ed9c6e21ba3fa3b |
|
MD5 | 0b37b3beff101ba4ef4be10524691cbf |
|
BLAKE2b-256 | e1f0e79d0c8035b60c2816adbb49b09821837349655c8ceafe983652eade7033 |