actionECS

delete_service

Delete an ECS service

Activity as code

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

Typeaction
Modulechaosaws.ecs.actions
Namedelete_service
Returnmapping

Update a given ECS service by updating it to set the desired count of tasks to 0 then delete it. If not provided, a random one will be picked up regarding service_pattern, if provided, so that only service names matching the pattern would be used. This should be a valid regex.

You can specify a cluster by its ARN identifier or, if not provided, the default cluster will be picked up.

Usage

JSON

{
  "name": "delete-service",
  "type": "action",
  "provider": {
    "type": "python",
    "module": "chaosaws.ecs.actions",
    "func": "delete_service"
  }
}

YAML

name: delete-service
provider:
  func: delete_service
  module: chaosaws.ecs.actions
  type: python
type: action

Arguments

NameTypeDefaultRequiredTitleDescription
servicestringnullNoServiceName of the target service
clusterstringnullNoClusterName of the target ECS cluster
service_patternstringnullNoService Patternyou can set this instead of a service name

Signature

def delete_service(
        service: str = None,
        cluster: str = None,
        service_pattern: str = None,
        configuration: Dict[str, Dict[str, str]] = None,
        secrets: Dict[str, Dict[str, str]] = None) -> Dict[str, Any]:
    pass