diff options
Diffstat (limited to 'src/cli.rs')
| -rw-r--r-- | src/cli.rs | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -7,7 +7,7 @@ use trust_dns_proto::rr::Name; use crate::apply::ApplyMode; use crate::aws_context::AwsContext; use crate::converge::named_asg_changes; -use crate::dns::absolute; +use crate::route53::Target; /// Synchronize a DNS entry with an autoscaling group's running instances. /// @@ -45,14 +45,9 @@ impl Args { let args = Args::parse(); let aws_context = AwsContext::from_env().await; + let target = self.target()?; - let changes = named_asg_changes( - &aws_context, - &args.autoscaling_group, - &absolute(args.dns_name)?, - args.dns_ttl, - ) - .await?; + let changes = named_asg_changes(&aws_context, &target, &args.autoscaling_group).await?; self.apply_mode() .apply( @@ -75,4 +70,9 @@ impl Args { (true, true) => unreachable!("Cannot set --apply and --dry-run together"), } } + + fn target(&self) -> Result<Target> { + let target = Target::new(&self.dns_name, self.dns_ttl)?; + Ok(target) + } } |
