{"id":23042644,"url":"https://github.com/nikhil-prabhu/cloud-detect","last_synced_at":"2025-10-06T01:28:44.269Z","repository":{"id":186734008,"uuid":"675660736","full_name":"nikhil-prabhu/cloud-detect","owner":"nikhil-prabhu","description":"A Rust library to detect the cloud service provider of a host.","archived":false,"fork":false,"pushed_at":"2025-08-10T11:00:24.000Z","size":285,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-16T16:38:03.934Z","etag":null,"topics":["alibaba-cloud","aws","azure","cloud","detection","devops","gcp","hyperscalers","metadata","multicloud","oracle-cloud","rust","vultr"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/cloud-detect","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nikhil-prabhu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-08-07T12:37:20.000Z","updated_at":"2025-08-10T11:00:28.000Z","dependencies_parsed_at":"2024-04-06T16:28:19.908Z","dependency_job_id":"6e9c483b-9609-4d4d-bd7c-efded0a171f4","html_url":"https://github.com/nikhil-prabhu/cloud-detect","commit_stats":{"total_commits":55,"total_committers":2,"mean_commits":27.5,"dds":"0.018181818181818188","last_synced_commit":"ead7905f80aac14ca342614e5e0dd3baa84290ce"},"previous_names":["nikhil-prabhu/cloud-detect"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/nikhil-prabhu/cloud-detect","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikhil-prabhu%2Fcloud-detect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikhil-prabhu%2Fcloud-detect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikhil-prabhu%2Fcloud-detect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikhil-prabhu%2Fcloud-detect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nikhil-prabhu","download_url":"https://codeload.github.com/nikhil-prabhu/cloud-detect/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikhil-prabhu%2Fcloud-detect/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278547774,"owners_count":26004772,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alibaba-cloud","aws","azure","cloud","detection","devops","gcp","hyperscalers","metadata","multicloud","oracle-cloud","rust","vultr"],"created_at":"2024-12-15T20:34:05.698Z","updated_at":"2025-10-06T01:28:44.249Z","avatar_url":"https://github.com/nikhil-prabhu.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cloud-detect\n\n![maintenance-status](https://img.shields.io/badge/maintenance-actively--developed-brightgreen.svg)\n[![crates-badge](https://img.shields.io/crates/v/cloud-detect.svg)](https://crates.io/crates/cloud-detect)\n[![License: GPL v3](https://img.shields.io/badge/license-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\n[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/license/mit)\n[![CI](https://github.com/nikhil-prabhu/cloud-detect/actions/workflows/ci.yml/badge.svg)](https://github.com/nikhil-prabhu/cloud-detect/actions)\n[![CD](https://github.com/nikhil-prabhu/cloud-detect/actions/workflows/cd.yml/badge.svg)](https://github.com/nikhil-prabhu/cloud-detect/actions)\n\nA Rust library to detect the cloud service provider of a host.\n\nThis library is inspired by the Python-based [cloud-detect](https://github.com/dgzlopes/cloud-detect)\nand the Go-based [satellite](https://github.com/banzaicloud/satellite) modules.\n\nLike these modules, `cloud-detect` uses a combination of checking vendor files and metadata endpoints to accurately\ndetermine the cloud provider of a host.\n\n## Features\n\n* Currently, this module supports the identification of the following providers:\n    - Akamai Cloud (`akamai`)\n    - Amazon Web Services (`aws`)\n    - Microsoft Azure (`azure`)\n    - Google Cloud Platform (`gcp`)\n    - Alibaba Cloud (`alibaba`)\n    - OpenStack (`openstack`)\n    - DigitalOcean (`digitalocean`)\n    - Oracle Cloud Infrastructure (`oci`)\n    - Vultr (`vultr`)\n* Fast, simple and extensible.\n* Real-time console logging using the [`tracing`](https://crates.io/crates/tracing) crate.\n\n## Usage\n\nFirst, add the library to your project by adding the following to your `Cargo.toml` file:\n\n```toml\n[dependencies]\n# ...\ncloud-detect = \"2\"\ntokio = { version = \"1\", features = [\"full\"] }\ntracing-subscriber = { version = \"0.3\", features = [\"env-filter\"] } # Optional; for logging.\n```\n\nTo use the non-async blocking API instead, enable the `blocking` feature:\n\n```toml\n[dependencies]\n# ...\ncloud-detect = { version = \"2\", features = [\"blocking\"] }\ntracing-subscriber = { version = \"0.3\", features = [\"env-filter\"] } # Optional; for logging.\n```\n\nDetect the cloud provider and print the result (with default timeout; async).\n\n```rust\nuse cloud_detect::detect;\n\n#[tokio::main]\nasync fn main() {\n    tracing_subscriber::fmt::init(); // Optional; for logging\n\n    let provider = detect(None).await;\n\n    // When tested on AWS:\n    println!(\"{}\", provider); // \"aws\"\n\n    // When tested on local/non-supported cloud environment:\n    println!(\"{}\", provider); // \"unknown\"\n}\n```\n\nDetect the cloud provider and print the result (with default timeout; blocking).\n\n```rust\nuse cloud_detect::blocking::detect;\n\nfn main() {\n    tracing_subscriber::fmt::init(); // Optional; for logging\n\n    let provider = detect(None).unwrap();\n\n    // When tested on AWS:\n    println!(\"{}\", provider); // \"aws\"\n\n    // When tested on local/non-supported cloud environment:\n    println!(\"{}\", provider); // \"unknown\"\n}\n```\n\nDetect the cloud provider and print the result (with custom timeout; async).\n\n```rust\nuse cloud_detect::detect;\n\n#[tokio::main]\nasync fn main() {\n    tracing_subscriber::fmt::init(); // Optional; for logging\n\n    let provider = detect(Some(10)).await;\n\n    // When tested on AWS:\n    println!(\"{}\", provider); // \"aws\"\n\n    // When tested on local/non-supported cloud environment:\n    println!(\"{}\", provider); // \"unknown\"\n}\n```\n\nDetect the cloud provider and print the result (with custom timeout; blocking).\n\n```rust\nuse cloud_detect::blocking::detect;\n\nfn main() {\n    tracing_subscriber::fmt::init(); // Optional; for logging\n\n    let provider = detect(Some(10)).unwrap();\n\n    // When tested on AWS:\n    println!(\"{}\", provider); // \"aws\"\n\n    // When tested on local/non-supported cloud environment:\n    println!(\"{}\", provider); // \"unknown\"\n}\n```\n\nYou can also check the list of currently supported cloud providers.\n\nAsync:\n\n```rust\nuse cloud_detect::supported_providers;\n\n#[tokio::main]\nasync fn main() {\n    println!(\"Supported providers: {:?}\", supported_providers().await);\n}\n```\n\nBlocking:\n\n```rust\nuse cloud_detect::blocking::supported_providers;\n\nfn main() {\n    println!(\"Supported providers: {:?}\", supported_providers().unwrap());\n}\n```\n\nFor more detailed documentation, please refer to the [Crate Documentation](https://docs.rs/cloud-detect).\n\n## Contributing\n\nContributions are welcome and greatly appreciated! If you’d like to contribute to cloud-detect, here’s how you can help.\n\n### 1. Report Issues\n\nIf you encounter a bug, unexpected behavior, or have a feature request, please open\nan [issue](https://github.com/nikhil-prabhu/cloud-detect/issues/new).\nBe sure to include:\n\n* A clear description of the issue.\n* Steps to reproduce, if applicable.\n* Details about your environment.\n\n### 2. Submit Pull Requests\n\nIf you're submitting a [pull request](https://github.com/nikhil-prabhu/cloud-detect/compare), please ensure the\nfollowing.\n\n* Your code is formatted using `cargo fmt` (the Rust `nightly` channel is required, as a few unstable features are\n  used).\n\n```bash\n$ cargo fmt +nightly --all\n$ cargo fmt +nightly --all --check\n```\n\n* Code lints pass with:\n\n```bash\n$ cargo clippy --all-targets --all-features --workspace -- -D warnings\n````\n\n* Your code contains sufficient unit tests and that all tests pass.\n\n```bash\n$ cargo test --locked --all-features --workspace\n```\n\n### 3. Improve Documentation\n\nIf you find areas in the documentation that are unclear or incomplete, feel free to update the README or crate-level\ndocumentation. Open a pull request with your improvements.\n\n### 4. Review Pull Requests\n\nYou can also contribute by\nreviewing [open pull requests](https://github.com/nikhil-prabhu/cloud-detect/pulls?q=is%3Aopen+is%3Apr). Providing\nconstructive feedback helps maintain a\nhigh-quality\ncodebase.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikhil-prabhu%2Fcloud-detect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnikhil-prabhu%2Fcloud-detect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikhil-prabhu%2Fcloud-detect/lists"}