waymond
waymond copied to clipboard
scaler(aws_ec2_asg): avoid multiple describe autoscaling group calls
When we evaluate a scaling event in aws_ec2_asg scaler, we are currently making the API call to get a list of ASGs twice.
https://github.com/scriptnull/waymond/blob/3dee33fba1f58cafae800d71d1a0efaa2f7c9e49/internal/scaler/awsec2asg/aws_ec2_asg.go#L118-L125
https://github.com/scriptnull/waymond/blob/3dee33fba1f58cafae800d71d1a0efaa2f7c9e49/internal/scaler/awsec2asg/aws_ec2_asg.go#L300-L307
This can be refactored to make it once if the ASG is detected in the first call spot.