AWS
probe EC2

# instance_state

Determines if EC2 instances match desired state

Run it now
View details

Type | probe
Module | chaosaws.ec2.probes
Name | instance_state
Return | boolean

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

Name | Type | Default | Required | Title | Description
--- | --- | --- | --- | --- | ---
instance_ids | list | null | No | Instance IDs | List of instance identifiers, or filters below
filters | list | null | No | Instance Filters | List of key/value pairs to select instances
state | string |  | Yes | State |

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

## Related starters

- AWS
  action EC2

  ## `start_instances`

  Starts one or more EC2 instances
- AWS
  action EC2

  ## `restart_instances`

  Restarts one or more EC2 instances
- AWS
  probe EC2

  ## `count_min_instances`

  Returns whether the number of instances matching the filters is superior to the min_count parameter