Mercurial > core / rust/lib/tenex/models/aws/lib.rs
changeset 698: |
96958d3eb5b0 |
parent: |
3d78bed56188
|
author: |
Richard Westhaver <ellis@rwest.io> |
date: |
Fri, 04 Oct 2024 22:04:59 -0400 |
permissions: |
-rw-r--r-- |
description: |
fixes |
1 //! aws/lib.rs --- AWS client model 2 pub use aws_config::{meta::region::RegionProviderChain, Region}; 3 pub fn new_region(region: Option<String>) -> RegionProviderChain { 4 RegionProviderChain::first_try(region.map(Region::new)) 6 .or_else(Region::new("us-east-2")) 10 pub async fn show_host_info( 11 client: &aws_sdk_route53::Client, 12 ) -> Result<(), aws_sdk_route53::Error> { 13 let hosted_zone_count = client.get_hosted_zone_count().send().await?; 16 "Number of hosted zones in region : {}", 17 hosted_zone_count.hosted_zone_count(), 20 let hosted_zones = client.list_hosted_zones().send().await?; 24 for hz in hosted_zones.hosted_zones() { 25 let zone_name = hz.name(); 26 let zone_id = hz.id(); 28 println!(" ID : {}", zone_id); 29 println!(" Name : {}", zone_name); 37 // pub async fn start_instance(client: &aws_sdk_ec2::Client, id: &str) -> 38 // Result<(), aws_sdk_ec2::Error> { client.start_instances(). 39 // instance_ids(id).send().await?; 41 // println!("Started instance."); 46 // pub async fn delete_snapshot(client: &aws_sdk_ec2::Client, id: &str) -> 47 // Result<(), aws_sdk_ec2::Error> { client.delete_snapshot(). 48 // snapshot_id(id).send().await?; Ok(())