Metadata-Version: 2.1
Name: cloud-instance
Version: 0.1.1
Summary: 
Home-page: https://github.com/fabiog1901/cloud_instance
License: GPLv3+
Author: Fabio Ghirardello
Requires-Python: >=3.11,<4.0
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Classifier: License :: Other/Proprietary License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: azure-common (>=1.1.28,<2.0.0)
Requires-Dist: azure-core (>=1.34.0,<2.0.0)
Requires-Dist: azure-identity (>=1.21.0,<2.0.0)
Requires-Dist: azure-mgmt-compute (>=34.1.0,<35.0.0)
Requires-Dist: azure-mgmt-core (>=1.5.0,<2.0.0)
Requires-Dist: azure-mgmt-network (>=28.1.0,<29.0.0)
Requires-Dist: azure-mgmt-resource (>=23.3.0,<24.0.0)
Requires-Dist: boto (>=2.49.0,<3.0.0)
Requires-Dist: boto3 (>=1.38.8,<2.0.0)
Requires-Dist: botocore (>=1.38.8,<2.0.0)
Requires-Dist: google-api-core (>=2.24.2,<3.0.0)
Requires-Dist: google-auth (>=2.39.0,<3.0.0)
Requires-Dist: google-cloud-compute (>=1.30.0,<2.0.0)
Requires-Dist: googleapis-common-protos (>=1.70.0,<2.0.0)
Project-URL: Repository, https://github.com/fabiog1901/cloud_instance
Description-Content-Type: text/markdown

# cloud_instance

Usage:

```text
cloud_instance <deployment_id> <present/absent> <deployment> <defaults>
```

Example:

```bash
$ cloud_instance \
    fabio1 \
    present \
    '[
        {
            "cluster_name": "fabio1",
            "copies": 1,
            "inventory_groups": ["haproxy"],
            "exact_count": 1,
            "instance": {"cpu": 4},
            "volumes": {"os": {"size": 20, "type": "standard_ssd"}, "data": []},
            "tags": {"Name": "fabio1-lb"},
            "project": "my-team",
            "groups": [
                {
                    "user": "ubuntu",
                    "public_ip": true,
                    "public_key_id": "workshop",
                    "tags": {"owner": "fabio"},
                    "cloud": "gcp",
                    "image": "projects/ubuntu-os-cloud/global/images/family/ubuntu-2004-lts",
                    "region": "us-east4",
                    "vpc_id": "default",
                    "security_groups": ["cockroachdb"],
                    "zone": "a",
                    "subnet": "default"
                }
            ]
        }
    ]' \
    '{
        "instances": {
            "aws": {
                "4": {
                    "default": "m6i.xlarge",
                    "16": "m6i.xlarge",
                    "32": "r5.xlarge"
                },
                "8": {
                    "default": "m6i.2xlarge",
                    "32": "m6i.2xlarge",
                    "64": "r5.2xlarge"
                }
            },
            "azure": {
                "4": {
                    "16": "Standard_D4s_v3",
                    "32": "Standard_E4s_v3",
                    "default": "Standard_D4s_v3"
                },
                "8": {
                    "32": "Standard_D8s_v3",
                    "64": "Standard_E8s_v3",
                    "default": "Standard_D8s_v3"
                }
            },
            "gcp": {
                "4": {
                    "default": "n2-standard-4",
                    "8": "n2-standard-4",
                    "16": "n2-highmem-4"
                },
                "8": {
                    "default": "n2-standard-8",
                    "16": "n2-standard-8",
                    "64": "n2-highmem-8"
                }
            }
        }
    }' | jq
```

Output, formatted thanks to `jq`:

```json
[
  {
    "id": "fabio1-7141637722071383",
    "cloud": "gcp",
    "region": "us-east4",
    "zone": "a",
    "public_ip": "35.245.214.0",
    "public_hostname": "0.214.245.35.bc.googleusercontent.com",
    "private_ip": "10.150.15.208",
    "private_hostname": "fabio1-7141637722071383.c.my-team.internal",
    "ansible_user": "ubuntu",
    "inventory_groups": [
      "haproxy",
      "fabio1-0"
    ],
    "cluster_name": "fabio1-0",
    "group_name": "haproxy",
    "extra_vars": "{}"
  }
]
```

