probeASG

instance_count_by_health

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

Activity as code

Below are the details and signature of the activity Python module.

Typeprobe
Modulechaosaws.asg.probes
Nameinstance_count_by_health
Returninteger

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

NameTypeDefaultRequiredTitleDescription
asg_nameslistnullNoASG NamesOne or many ASG names as a JSON encoded list
tagslistnullNoASG TagsList of AWS tags for to identify ASG by tags instead of by names
count_healthybooleantrueNoCount Only HealthyCount only healthy ASG

One of:

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