AWS
action ECS

# stop_random_tasks

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

Run it now
View details

Type | action
Module | chaosaws.ecs.actions
Name | stop_random_tasks
Return | list

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

Name | Type | Default | Required | Title | Description
--- | --- | --- | --- | --- | ---
cluster | string |  | Yes | Cluster | Name of the target ECS cluster
service | string | null | No | Service | Name of the target service
task_count | integer | null | No | Task Count | Number of tasks to stop
task_percent | integer | null | No | Task Percent | Volume of tasks (0-100) to stop
reason | string | ”Reliably Planned Experiment” | No | Reason | Reason 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

## Related starters

- AWS
  action ECS

  ## `tag_resource`

  Tags the provided resource(s) with provided tags
- AWS
  probe ECS

  ## `describe_tasks`

  Returns AWS response describing the tasks for a provided cluster
- AWS
  probe ECS

  ## `are_all_desired_tasks_running`

  Checks to make sure desired and running tasks counts are equal