From 1754b64db14a1ea409779738a84d020fbb1ac79b Mon Sep 17 00:00:00 2001 From: Owen Jacobson Date: Thu, 25 Jul 2024 20:01:46 -0400 Subject: Unify dns_name and dns_ttl into a "target" type, pass that around. --- src/autoscaling.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/autoscaling.rs') diff --git a/src/autoscaling.rs b/src/autoscaling.rs index 024b556..79ac2b0 100644 --- a/src/autoscaling.rs +++ b/src/autoscaling.rs @@ -4,10 +4,10 @@ use anyhow::{anyhow, bail, Result}; use aws_sdk_autoscaling as autoscaling; use aws_sdk_autoscaling::types::{AutoScalingGroup, Instance, LifecycleState}; use aws_sdk_route53::types::ResourceRecordSet; -use trust_dns_proto::rr::Name; -use crate::ec2::{instance_proposal, Ec2}; +use crate::ec2::{asg_instances_proposal, Ec2}; use crate::hashable::Hashable; +use crate::route53::Target; pub trait AutoScaling { fn autoscaling(&self) -> &autoscaling::Client; @@ -15,9 +15,8 @@ pub trait AutoScaling { pub async fn propose_asg_recordsets( aws_context: &C, + target: &Target, asg_name: &str, - dns_name: &Name, - dns_ttl: i64, ) -> Result>> where C: AutoScaling + Ec2, @@ -28,7 +27,7 @@ where .ok_or(anyhow!("Autoscaling group returned from AWS with no name"))?; let live_instance_ids = live_instance_ids(asg.instances()); let proposed = - instance_proposal(aws_context, asg_name, dns_name, dns_ttl, &live_instance_ids).await?; + asg_instances_proposal(aws_context, target, asg_name, &live_instance_ids).await?; Ok(proposed) } -- cgit v1.2.3