aws/
aws.rs

1#[cfg(feature = "aws")]
2use cloud_node_discovery::{Discovery, DiscoveryError};
3
4#[cfg(feature = "aws")]
5use tokio;
6
7#[cfg(feature = "aws")]
8#[tokio::main]
9async fn main() -> Result<(), DiscoveryError> {
10    let discovery = Discovery::new("aws", "region=us-east-1,tag_key=foo,tag_value=bar").await?;
11    let nodes = discovery.discover().await.unwrap();
12    println!("{:?}", nodes);
13    Ok(())
14}
15
16
17#[cfg(not(feature = "aws"))]
18fn main() {
19    println!("This example requires the 'aws' feature to be enabled.");
20    println!("Please run with: cargo run --example aws --features aws");
21}