AWS
probe ASG

# instance_count_by_health

Reports the number of instances currently in the ASG by their health status

Run it now
View details

Type | probe
Module | chaosaws.asg.probes
Name | instance_count_by_health
Return | integer

Usage

JSON

    {
      "name": "instance-count-by-health",
      "type": "probe",
      "provider": {
        "type": "python",
        "module": "chaosaws.asg.probes",
        "func": "instance_count_by_health"
      }
    }

YAML

    name: instance-count-by-health
    provider:
      func: instance_count_by_health
      module: chaosaws.asg.probes
      type: python
    type: probe

Arguments

Name | Type | Default | Required | Title | Description
--- | --- | --- | --- | --- | ---
asg_names | list | null | No | ASG Names | One or many ASG names as a JSON encoded list
tags | list | null | No | ASG Tags | List of AWS tags for to identify ASG by tags instead of by names
count_healthy | boolean | true | No | Count Only Healthy | Count only healthy ASG

One of:

- asg_names: a list of asg names to describe
- tags: a list of key/value pairs to collect ASG(s)

count_healthy: boolean: true for healthy instance count, false for unhealthy instance count

`tags` are expected as a list of dictionary objects:

    [
        {'Key': 'TagKey1', 'Value': 'TagValue1'},
        {'Key': 'TagKey2', 'Value': 'TagValue2'},
        ...
    ]

Signature

    def instance_count_by_health(asg_names: List[str] = None,
                                 tags: List[Dict[str, str]] = None,
                                 count_healthy: bool = True,
                                 configuration: Dict[str, Dict[str, str]] = None,
                                 secrets: Dict[str, Dict[str, str]] = None) -> int:
        pass

## Related starters

- AWS
  probe ASG

  ## `wait_desired_equals_healthy`

  Wait until the desired number matches the number of healthy instances for each auto-scaling group
- AWS
  action ASG

  ## `detach_random_volume`

  Detaches a random (non root) ebs volume from ec2 instances associated to an ASG
- AWS
  action ASG

  ## `stop_random_instances`

  Terminates one or more random healthy instances associated with an ALB