cloud-detect
Rust library that detects a host's cloud service provider.
This library is heavily inspired by the Python cloud-detect module, and replicates most of its functionality (even most of the code is structured similarly).
Features
- Supports the identification of the following providers:
- Amazon Web Services (
aws) - Microsoft Azure (
azure) - Google Cloud Platform (
gcp) - Alibaba Cloud (
alibaba) - OpenStack (
openstack) - DigitalOcean (
digitalocean) - Oracle Cloud Infrastructure (
oci) - Vultr (
vultr)
- Amazon Web Services (
- Fast, simple and extensible.
- Real-time logging in the console.
Requirements
Linux
OpenSSL 1.0.1, 1.0.2, 1.1.0, or 1.1.1 with headers (see https://github.com/sfackler/rust-openssl)
Ubuntu and Debian-based distributions
Fedora and RHEL-based distributions
OR
SLES and openSUSE
Arch Linux
Usage
First, add the library to your project by adding the following to your Cargo.toml file:
[]
= "1.0.0"
= { = "1.29.1", = ["full"] }
= "0.3.17" # Only needed if real-time logging is required.
Next, you can detect the current host's cloud provider as follows:
use detect;
async
You can also check the list of currently supported cloud providers.
use SUPPORTED_PROVIDERS;
async
NOTE: Currently, only asynchronous detection is supported. Blocking detection may be added to a future release.
Contributing
TODO