Unverified Commit 32949d68 authored by Al McLean's avatar Al McLean Committed by GitHub
Browse files

Add Route 53 Support (#457)



* Initial r53 model results in malformed url

* Merge with main, fix route 53

Co-authored-by: default avatarRussell Cohen <rcoh@amazon.com>
parent 97cc7b5c
Loading
Loading
Loading
Loading
+8918 −0

File added.

Preview size limit exceeded, changes collapsed.

+13 −0
Original line number Diff line number Diff line
[package]
name = "route53-helloworld"
version = "0.1.0"
authors = ["Alistair McLean <mclean@amazon.com>"]
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
route53 = { package = "aws-sdk-route53", path = "../../build/aws-sdk/route53" }
tokio = { version = "1", features = ["full"] }
# used only to enable basic logging:
env_logger = "0.8.2"
+25 −0
Original line number Diff line number Diff line
#[tokio::main]
async fn main() -> Result<(), route53::Error> {
    env_logger::init();

    let client = route53::Client::from_env();
    let hosted_zone_count = client.get_hosted_zone_count().send().await?;

    println!(
        "Number of hosted zones in the account : {}",
        hosted_zone_count.hosted_zone_count.unwrap_or_default(),
    );

    let hosted_zones = client.list_hosted_zones().send().await?;

    for hz in hosted_zones.hosted_zones.unwrap_or_default() {
        let zone_name = hz.name.as_deref().unwrap_or_default();
        let zone_id = hz.id.as_deref().unwrap_or_default();

        println!("Zone ID : {}, Zone Name : {}", zone_id, zone_name);
    }

    println!("Hello, world!");

    Ok(())
}