Get scaled values from current ASG

parent 4a84b536
......@@ -20,7 +20,12 @@ class ASG():
self.role_arn = role_arn
self.asg = asg
self.target_group = target_group
self.scale_to = scale_to if scale_to else 1
if not scale_to:
asg_client = aws_client.create_client('autoscaling', self.region, self.role_arn)
asg = asg_client.describe_auto_scaling_groups(AutoScalingGroupNames=[self.asg])['AutoScalingGroups'][0]
self.scale_to = scale_to if scale_to else asg['DesiredCapacity']
def get_application_name(self):
  • botocore.exceptions.ParamValidationError: Parameter validation failed:
    Invalid type for parameter AutoScalingGroupNames[0], value: None, type: <class 'NoneType'>, valid types: <class 'str'>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment