probeEC2

count_instances

Return count of instances matching the specified filters

Activity as code

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

Typeprobe
Modulechaosaws.ec2.probes
Namecount_instances
Returninteger

Usage

JSON

{
  "name": "count-instances",
  "type": "probe",
  "provider": {
    "type": "python",
    "module": "chaosaws.ec2.probes",
    "func": "count_instances",
    "arguments": {
      "filters": []
    }
  }
}

YAML

name: count-instances
provider:
  arguments:
    filters: []
  func: count_instances
  module: chaosaws.ec2.probes
  type: python
type: probe

Arguments

NameTypeDefaultRequiredTitleDescription
filterslistnullNoInstance FiltersList of key/value pairs to select instances

Please refer to https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ec2/client/describe_instances.html# for details on filters.

Signature

def count_instances(filters: List[Dict[str, Any]],
                    configuration: Dict[str, Dict[str, str]] = None,
                    secrets: Dict[str, Dict[str, str]] = None) -> int:
    pass