changeset 65: |
06f6bc7a778e |
parent 64: |
c30e4700b7c9 |
child 66: |
5de6b232e51d |
author: |
ellis <ellis@rwest.io> |
date: |
Fri, 01 Dec 2023 23:09:13 -0500 |
files: |
rust/lib/tenex/Cargo.toml rust/lib/tenex/models/aws/Cargo.toml rust/lib/tenex/models/aws/lib.rs |
description: |
init tenex/aws |
1.1--- a/rust/lib/tenex/Cargo.toml Fri Dec 01 19:52:59 2023 -0500
1.2+++ b/rust/lib/tenex/Cargo.toml Fri Dec 01 23:09:13 2023 -0500
1.3@@ -8,6 +8,7 @@
1.4 "models/gitlab",
1.5 "models/nws",
1.6 "models/ipapi",
1.7+ "models/aws",
1.8 "util"]
1.9
1.10 [features]
1.11@@ -15,11 +16,12 @@
1.12 oauth = ["tenex-util/oauth2"]
1.13 progress = ["tenex-util/indicatif"]
1.14 default = ["util"]
1.15-full = ["ipapi","nws","freesound","gitlab","util","oauth","progress"]
1.16+full = ["ipapi","nws","freesound","gitlab","util","oauth","progress","aws"]
1.17
1.18 [dependencies]
1.19 tenex-util = { path = "util", optional = true }
1.20 ipapi = { path = "models/ipapi", optional = true }
1.21+aws = { path = "models/aws", optional = true }
1.22 gitlab = { path = "models/gitlab", optional = true }
1.23 nws = { path = "models/nws", optional = true }
1.24 freesound = { path = "models/freesound", optional = true }
2.1--- /dev/null Thu Jan 01 00:00:00 1970 +0000
2.2+++ b/rust/lib/tenex/models/aws/Cargo.toml Fri Dec 01 23:09:13 2023 -0500
2.3@@ -0,0 +1,11 @@
2.4+[package]
2.5+name = "aws"
2.6+version = "0.1.0"
2.7+edition = "2021"
2.8+[lib]
2.9+name = "aws"
2.10+path = "lib.rs"
2.11+[dependencies]
2.12+aws-config = { version= "1.0.1", features = ["behavior-version-latest"] }
2.13+aws-sdk-route53 = "1.2.0"
2.14+tokio = { version = "1", features = ["full"] }
2.15\ No newline at end of file
3.1--- /dev/null Thu Jan 01 00:00:00 1970 +0000
3.2+++ b/rust/lib/tenex/models/aws/lib.rs Fri Dec 01 23:09:13 2023 -0500
3.3@@ -0,0 +1,24 @@
3.4+
3.5+async fn show_host_info(client: &aws_sdk_route53::Client) -> Result<(), aws_sdk_route53::Error> {
3.6+ let hosted_zone_count = client.get_hosted_zone_count().send().await?;
3.7+
3.8+ println!(
3.9+ "Number of hosted zones in region : {}",
3.10+ hosted_zone_count.hosted_zone_count(),
3.11+ );
3.12+
3.13+ let hosted_zones = client.list_hosted_zones().send().await?;
3.14+
3.15+ println!("Zones:");
3.16+
3.17+ for hz in hosted_zones.hosted_zones() {
3.18+ let zone_name = hz.name();
3.19+ let zone_id = hz.id();
3.20+
3.21+ println!(" ID : {}", zone_id);
3.22+ println!(" Name : {}", zone_name);
3.23+ println!();
3.24+ }
3.25+
3.26+ Ok(())
3.27+}