From c9aded75272a42bb5d2b5b00b69d15c3e3dc000f Mon Sep 17 00:00:00 2001 From: Owen Jacobson Date: Tue, 30 Jul 2024 11:19:09 -0400 Subject: Unify the apply arguments into a `Transaction` record type. --- src/cli.rs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'src/cli.rs') diff --git a/src/cli.rs b/src/cli.rs index 7a8d2c7..972f13c 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -6,7 +6,7 @@ use trust_dns_proto::rr::Name; use crate::apply::ApplyMode; use crate::aws_context::AwsContext; -use crate::converge::named_asg_changes; +use crate::converge::propose_transaction; use crate::route53::Target; /// Synchronize a DNS entry with an autoscaling group's running instances. @@ -47,16 +47,10 @@ impl Args { let aws_context = AwsContext::from_env().await; let target = self.target()?; - let changes = named_asg_changes(&aws_context, &target, &args.autoscaling_group).await?; + let transaction = + propose_transaction(&aws_context, &target, &args.autoscaling_group).await?; - self.apply_mode() - .apply( - &aws_context, - &changes.zone_id, - changes.remove, - changes.insert, - ) - .await?; + self.apply_mode().apply(&aws_context, transaction).await?; Ok(()) } -- cgit v1.2.3