autoscaling

how to tag an existing AWS autoscaling group with boto3

how to tag an existing AWS autoscaling group with boto3 Question: I’m trying to tag an existing autoscaling group, using Python and Boto3. I can definitely describe the ASGs by name: import boto3 asg_client = boto3.client("autoscaling") asg_name = "foo-bar20220502044025104700000001" response = asg_client.describe_auto_scaling_groups(AutoScalingGroupNames=[asg_name]) The problem I have with the create_or_update_tags() and delete_tags() methods is that they …

Total answers: 1

Issues Adjusting Auto-scaling Desired Capacity

Issues Adjusting Auto-scaling Desired Capacity Question: I have this code that ran successfully locally, but not on AWS. import boto3 client = boto3.client(‘autoscaling’) def set_desired_capacity(AutoScalingGroupName, DesiredCapacity): response = client.set_desired_capacity( AutoScalingGroupName=’My_Auto_Scaling_Group’, DesiredCapacity =2, HonorCooldown=True, ) return response def lambda_handler(event, context): Auto_scale = set_desired_capacity(AutoScalingGroupName, DesiredCapacity) print(‘Executed successfuly’) I keep getting this error at the line inside the …

Total answers: 1