action ECS

stop_random_tasks

Stop a random number of tasks based on given task_count or task_percent

Run it now
View details
Typeaction
Modulechaosaws.ecs.actions
Namestop_random_tasks
Returnlist

Usage

JSON

{
  "name": "stop-random-tasks",
  "type": "action",
  "provider": {
    "type": "python",
    "module": "chaosaws.ecs.actions",
    "func": "stop_random_tasks",
    "arguments": {
      "cluster": ""
    }
  }
}

YAML

name: stop-random-tasks
provider:
  arguments:
    cluster: ""
  func: stop_random_tasks
  module: chaosaws.ecs.actions
  type: python
type: action

Arguments

NameTypeDefaultRequiredTitleDescription
clusterstringYesClusterName of the target ECS cluster
servicestringnullNoServiceName of the target service
task_countintegernullNoTask CountNumber of tasks to stop
task_percentintegernullNoTask PercentVolume of tasks (0-100) to stop
reasonstring”Reliably Planned Experiment”NoReasonReason why stopping the tasks
  • cluster: The ECS cluster name or ARN, if not provided, the default cluster will be picked up.
  • task_count: The number of tasks to stop
  • task_percent: The percentage of total tasks to stop
  • service: The ECS service name
  • reason: An explanation of why the service was stopped

Signature

def stop_random_tasks(
        cluster: str,
        task_count: int = None,
        task_percent: int = None,
        service: str = None,
        reason: str = 'Chaos Testing',
        configuration: Dict[str, Dict[str, str]] = None,
        secrets: Dict[str, Dict[str, str]] = None) -> List[Dict[str, Any]]:
    pass