actionEC2

detach_random_volume

Detaches a random (non-root) ebs volume from one or more EC2 instances

Activity as code

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

Typeaction
Modulechaosaws.ec2.actions
Namedetach_random_volume
Returnlist

Usage

JSON

{
  "name": "detach-random-volume",
  "type": "action",
  "provider": {
    "type": "python",
    "module": "chaosaws.ec2.actions",
    "func": "detach_random_volume"
  }
}

YAML

name: detach-random-volume
provider:
  func: detach_random_volume
  module: chaosaws.ec2.actions
  type: python
type: action

Arguments

NameTypeDefaultRequiredTitleDescription
instance_idslistnullNoInstance IDsList of instance identifiers, or filters below
filterslistnullNoInstance FiltersList of key/value pairs to select instances
forcebooleantrueNoForceForce to detach the volume

One of:

force: force detach volume (default: true)

Additional filters may be used to narrow the scope: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ec2.html#EC2.Client.describe_instances

Signature

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