Module that determines a host's cloud provider
Project description
cloud-detect
About
cloud-detect
is a Python module that determines a host's cloud provider. Highly inspired by the Go based Satellite, cloud-detect
uses the same techniques (file systems and provider metadata) to properly identify cloud providers.
Features
- Supports identification of Alibaba, AWS, Azure, Digital Ocean, GCP and Oracle Cloud hosts.
- Fast and supports asyncio
- Logging integration.
- Small and extensible.
Usage
>>> from cloud_detect import provider
>>> provider()
'aws'
>>> provider() # when tested in local/non-supported cloud env
'unknown'
Right now the only possible responses are: 'alibaba', 'aws', 'azure', 'do', 'gcp', 'oci' or 'unknown'
You can get the list of supported providers using
>>> from cloud_detect import SUPPORTED_PROVIDERS
Installation
Via pip:
pip install cloud-detect
Examples
Termination-handler uses cloud-detect to keep the handling of termination notices on spot/preemptible instances cloud-agnostic, making easier to operate the same tooling in various distinct environments.
How to contribute
- Check for open issues or open a fresh issue to start a discussion around a feature idea or a bug.
- Fork the repository on GitHub to start making your changes to the master branch (or branch off of it).
- Write a test which shows that the bug was fixed or that the feature works as expected.
- Send a pull request and bug me until it gets merged and published.
Some things that would be great to have:
- Add cloud providers (Vultr)
- Add codecov
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 cloud_detect-0.0.9-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc5a0216cfdf56715076fcfcf7e5c505af6a1e40f209142db394b127a3e70f37 |
|
MD5 | 7fc0a2f7c7459e59f9fdb073070386d9 |
|
BLAKE2b-256 | 94736869d99777139f65316028f4e1950404149db6762baef5aa2ee877963093 |