Skip to content

Commit

Permalink
fix: waiter requires extra permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
laurelmay committed May 2, 2024
1 parent 5d21737 commit 155902d
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ pub mod ipaddr;

use std::net::Ipv4Addr;
use std::path::PathBuf;
use std::time::Duration;

use aws_sdk_route53::client::Waiters;
use aws_sdk_route53::error::BuildError;
use aws_sdk_route53::types::{
Change, ChangeAction, ChangeBatch, ResourceRecord, ResourceRecordSet, RrType,
Expand All @@ -17,8 +15,6 @@ use clap::{value_parser, Arg, ArgAction, Command};
use config::parse_config;
use ipaddr::{create_dns_client, get_ip, is_current_address};

const MAX_WAIT_TIMEOUT: Duration = Duration::from_secs(300);

#[derive(Debug)]
struct Opt {
config_file: PathBuf,
Expand Down Expand Up @@ -84,17 +80,5 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
.change_batch(batch);
let resp = req.send().await?;
println!("Request response: {:?}", resp);

let change_id = resp
.change_info()
.map(|info| info.id())
.ok_or("No change info")?;
let result = client
.wait_until_resource_record_sets_changed()
.id(change_id)
.wait(MAX_WAIT_TIMEOUT)
.await?;

println!("Result after waiting: {:?}", result);
Ok(())
}

0 comments on commit 155902d

Please sign in to comment.