Skip to content
Module that determines a host's cloud provider.
Python Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
cloud_detect
tests
.gitignore
.pre-commit-config.yaml
.travis.yml
LICENSE.md
Makefile
README.md
requirements-dev.txt
setup.py
tox.ini

README.md

cloud-detect

PyPI - Python Version PyPI PyPI - License Build Status

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 AWS, GCP, Azure and Digital Ocean hosts.
  • Supports skipping providers identification.
  • Logging integration.
  • Small and extensible.

Usage

>>> from cloud_detect import provider
>>> provider()
'aws'
>>> provider(excluded='aws')
'unknown'

Right now the only possible responses are: 'aws', 'gcp', 'do', 'azure' or 'unknown'

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

  1. Check for open issues or open a fresh issue to start a discussion around a feature idea or a bug.
  2. Fork the repository on GitHub to start making your changes to the master branch (or branch off of it).
  3. Write a test which shows that the bug was fixed or that the feature works as expected.
  4. 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, Oracle)
  • Add codecov
You can’t perform that action at this time.