probeEC2

instance_state

Determines if EC2 instances match desired state

Activity as code

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

Typeprobe
Modulechaosaws.ec2.probes
Nameinstance_state
Returnboolean

Usage

JSON

{
  "name": "instance-state",
  "type": "probe",
  "provider": {
    "type": "python",
    "module": "chaosaws.ec2.probes",
    "func": "instance_state",
    "arguments": {
      "state": ""
    }
  }
}

YAML

name: instance-state
provider:
  arguments:
    state: ""
  func: instance_state
  module: chaosaws.ec2.probes
  type: python
type: probe

Arguments

NameTypeDefaultRequiredTitleDescription
instance_idslistnullNoInstance IDsList of instance identifiers, or filters below
filterslistnullNoInstance FiltersList of key/value pairs to select instances
statestringYesState

For additional filter options, please refer to the documentation : https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ec2.html#EC2.Client.describe_instances

Signature

def instance_state(state: str,
                   instance_ids: List[str] = None,
                   filters: List[Dict[str, Any]] = None,
                   configuration: Dict[str, Dict[str, str]] = None,
                   secrets: Dict[str, Dict[str, str]] = None) -> bool:
    pass