ecsroll.py
def check_instances_protected_from_scale_in(as_client, cluster_instances):
    """
    Instances that already have Scale In protection will make ecsroll wait forever to scale down.
    :return: list
    """
    instance_ids = list(map(lambda x: x[0], cluster_instances))
    instances = as_client.describe_auto_scaling_instances(InstanceIds=instance_ids)
    instances_with_autoscaling_protection = filter(lambda x: x['ProtectedFromScaleIn'] is True,
                                                   instances['AutoScalingInstances'])
    return list(map(lambda x: x['InstanceId'], instances_with_autoscaling_protection))

    Instances that already have Scale In protection will make ecsroll wait forever to scale down.
    :return: list
    
Instances that already have Scale In protection will make ecsroll wait forever to scale down.
Instances that already have Scale In protection will make ecsroll wait forever to scale down .
def check_instances_protected_from_scale_in(as_client, cluster_instances):
    instance_ids = list(map(lambda x: x[0], cluster_instances))
    instances = as_client.describe_auto_scaling_instances(InstanceIds=instance_ids)
    instances_with_autoscaling_protection = filter(lambda x: x['ProtectedFromScaleIn'] is True,
                                                   instances['AutoScalingInstances'])
    return list(map(lambda x: x['InstanceId'], instances_with_autoscaling_protection))
def check_instances_protected_from_scale_in ( as_client , cluster_instances ) : instance_ids = list ( map ( lambda x : x [ 0 ] , cluster_instances ) ) instances = as_client . describe_auto_scaling_instances ( InstanceIds = instance_ids ) instances_with_autoscaling_protection = filter ( lambda x : x [ 'ProtectedFromScaleIn' ] is True , instances [ 'AutoScalingInstances' ] ) return list ( map ( lambda x : x [ 'InstanceId' ] , instances_with_autoscaling_protection ) )
Instances that already have Scale In protection will make ecsroll wait forever to scale down.
Instances that already have Scale In protection will make ecsroll wait forever to scale down .
"""
    Instances that already have Scale In protection will make ecsroll wait forever to scale down.
    :return: list
    """
None
as_client
cluster_instances