Skip to content

Extension chaosaws

Version 0.8.0
Repository https://github.com/chaostoolkit-incubator/chaostoolkit-aws

N/A

Exported Activities

awslambda


delete_function_concurrency

Type action
Module chaosaws.awslambda.actions
Name delete_function_concurrency
Return mapping

Removes concurrency limit applied to the specified Lambda

Signature:

def delete_function_concurrency(
        function_name: str,
        configuration: Dict[str, Dict[str, str]] = None,
        secrets: Dict[str, Dict[str, str]] = None) -> Dict[str, Any]:
    pass

Arguments:

Name Type Default Required
function_name string Yes

Usage:

{
  "provider": {
    "module": "chaosaws.awslambda.actions",
    "type": "python",
    "arguments": {
      "function_name": ""
    },
    "func": "delete_function_concurrency"
  },
  "type": "action",
  "name": "delete-function-concurrency"
}
name: delete-function-concurrency
provider:
  arguments:
    function_name: ''
  func: delete_function_concurrency
  module: chaosaws.awslambda.actions
  type: python
type: action

get_function_concurrency

Type probe
Module chaosaws.awslambda.probes
Name get_function_concurrency
Return boolean

Get configuration information of lambda by its function name

Signature:

def get_function_concurrency(
        function_name: str,
        configuration: Dict[str, Dict[str, str]] = None,
        secrets: Dict[str, Dict[str, str]] = None) -> bool:
    pass

Arguments:

Name Type Default Required
function_name string Yes

Usage:

{
  "provider": {
    "module": "chaosaws.awslambda.probes",
    "type": "python",
    "arguments": {
      "function_name": ""
    },
    "func": "get_function_concurrency"
  },
  "type": "probe",
  "name": "get-function-concurrency"
}
name: get-function-concurrency
provider:
  arguments:
    function_name: ''
  func: get_function_concurrency
  module: chaosaws.awslambda.probes
  type: python
type: probe

put_function_concurrency

Type action
Module chaosaws.awslambda.actions
Name put_function_concurrency
Return mapping

Throttles Lambda by setting reserved concurrency amount.

Signature:

def put_function_concurrency(
        function_name: str,
        concurrent_executions: int,
        configuration: Dict[str, Dict[str, str]] = None,
        secrets: Dict[str, Dict[str, str]] = None) -> Dict[str, Any]:
    pass

Arguments:

Name Type Default Required
function_name string Yes
concurrent_executions integer Yes

Usage:

{
  "provider": {
    "module": "chaosaws.awslambda.actions",
    "type": "python",
    "arguments": {
      "function_name": "",
      "concurrent_executions": 0
    },
    "func": "put_function_concurrency"
  },
  "type": "action",
  "name": "put-function-concurrency"
}
name: put-function-concurrency
provider:
  arguments:
    concurrent_executions: 0
    function_name: ''
  func: put_function_concurrency
  module: chaosaws.awslambda.actions
  type: python
type: action

elbv2


all_targets_healthy

Type probe
Module chaosaws.elbv2.probes
Name all_targets_healthy
Return mapping

Return true/false based on if all targets for listed target groups are healthy

Signature:

def all_targets_healthy(
        tg_names: List[str],
        configuration: Dict[str, Dict[str, str]] = None,
        secrets: Dict[str, Dict[str, str]] = None) -> Dict[str, Any]:
    pass

Arguments:

Name Type Default Required
tg_names list Yes

Usage:

{
  "provider": {
    "module": "chaosaws.elbv2.probes",
    "type": "python",
    "arguments": {
      "tg_names": []
    },
    "func": "all_targets_healthy"
  },
  "type": "probe",
  "name": "all-targets-healthy"
}
name: all-targets-healthy
provider:
  arguments:
    tg_names: []
  func: all_targets_healthy
  module: chaosaws.elbv2.probes
  type: python
type: probe

deregister_target

Type action
Module chaosaws.elbv2.actions
Name deregister_target
Return mapping

Deregisters one random target from target group

Signature:

def deregister_target(
        tg_name: str,
        configuration: Dict[str, Dict[str, str]] = None,
        secrets: Dict[str, Dict[str, str]] = None) -> Dict[str, Any]:
    pass

Arguments:

Name Type Default Required
tg_name string Yes

Usage:

{
  "provider": {
    "module": "chaosaws.elbv2.actions",
    "type": "python",
    "arguments": {
      "tg_name": ""
    },
    "func": "deregister_target"
  },
  "type": "action",
  "name": "deregister-target"
}
name: deregister-target
provider:
  arguments:
    tg_name: ''
  func: deregister_target
  module: chaosaws.elbv2.actions
  type: python
type: action

targets_health_count

Type probe
Module chaosaws.elbv2.probes
Name targets_health_count
Return mapping

Count of healthy/unhealthy targets per targetgroup

Signature:

def targets_health_count(
        tg_names: List[str],
        configuration: Dict[str, Dict[str, str]] = None,
        secrets: Dict[str, Dict[str, str]] = None) -> Dict[str, Any]:
    pass

Arguments:

Name Type Default Required
tg_names list Yes

Usage:

{
  "provider": {
    "module": "chaosaws.elbv2.probes",
    "type": "python",
    "arguments": {
      "tg_names": []
    },
    "func": "targets_health_count"
  },
  "type": "probe",
  "name": "targets-health-count"
}
name: targets-health-count
provider:
  arguments:
    tg_names: []
  func: targets_health_count
  module: chaosaws.elbv2.probes
  type: python
type: probe

ec2


count_instances

Type probe
Module chaosaws.ec2.probes
Name count_instances
Return mapping

Return count of instances matching the specified filters.

Please refer to http://boto3.readthedocs.io/en/latest/reference/services/ec2.html#EC2.Client.describe_instances

for details on said filters.

Signature:

def count_instances(
        filters: List[Dict[str, Any]],
        configuration: Dict[str, Dict[str, str]] = None,
        secrets: Dict[str, Dict[str, str]] = None) -> Dict[str, Any]:
    pass

Arguments:

Name Type Default Required
filters list Yes

Usage:

{
  "provider": {
    "module": "chaosaws.ec2.probes",
    "type": "python",
    "arguments": {
      "filters": []
    },
    "func": "count_instances"
  },
  "type": "probe",
  "name": "count-instances"
}
name: count-instances
provider:
  arguments:
    filters: []
  func: count_instances
  module: chaosaws.ec2.probes
  type: python
type: probe

describe_instances

Type probe
Module chaosaws.ec2.probes
Name describe_instances
Return mapping

Describe instances following the specified filters.

Please refer to http://boto3.readthedocs.io/en/latest/reference/services/ec2.html#EC2.Client.describe_instances

for details on said filters.

Signature:

def describe_instances(
        filters: List[Dict[str, Any]],
        configuration: Dict[str, Dict[str, str]] = None,
        secrets: Dict[str, Dict[str, str]] = None) -> Dict[str, Any]:
    pass

Arguments:

Name Type Default Required
filters list Yes

Usage:

{
  "provider": {
    "module": "chaosaws.ec2.probes",
    "type": "python",
    "arguments": {
      "filters": []
    },
    "func": "describe_instances"
  },
  "type": "probe",
  "name": "describe-instances"
}
name: describe-instances
provider:
  arguments:
    filters: []
  func: describe_instances
  module: chaosaws.ec2.probes
  type: python
type: probe

stop_instance

Type action
Module chaosaws.ec2.actions
Name stop_instance
Return mapping

Stop a single EC2 instance.

You may provide an instance id explicitely or, if you only specify the AZ, a random instance will be selected. If you need more control, you can also provide a list of filters following the documentation https://boto3.readthedocs.io/en/latest/reference/services/ec2.html#EC2.Client.describe_instances

Signature:

def stop_instance(instance_id: str = None,
                  az: str = None,
                  force: bool = False,
                  filters: List[Dict[str, Any]] = None,
                  configuration: Dict[str, Dict[str, str]] = None,
                  secrets: Dict[str, Dict[str, str]] = None) -> Dict[str, Any]:
    pass

Arguments:

Name Type Default Required
instance_id string null No
az string null No
force boolean false No
filters list null No

Usage:

{
  "provider": {
    "module": "chaosaws.ec2.actions",
    "type": "python",
    "func": "stop_instance"
  },
  "type": "action",
  "name": "stop-instance"
}
name: stop-instance
provider:
  func: stop_instance
  module: chaosaws.ec2.actions
  type: python
type: action

stop_instances

Type action
Module chaosaws.ec2.actions
Name stop_instances
Return mapping

Stop the given EC2 instances or, if none is provided, all instances of the given availability zone. If you need more control, you can also provide a list of filters following the documentation https://boto3.readthedocs.io/en/latest/reference/services/ec2.html#EC2.Client.describe_instances

Signature:

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

Arguments:

Name Type Default Required
instance_ids list null No
az string null No
filters list null No
force boolean false No

Usage:

{
  "provider": {
    "module": "chaosaws.ec2.actions",
    "type": "python",
    "func": "stop_instances"
  },
  "type": "action",
  "name": "stop-instances"
}
name: stop-instances
provider:
  func: stop_instances
  module: chaosaws.ec2.actions
  type: python
type: action

iam


attach_role_policy

Type action
Module chaosaws.iam.actions
Name attach_role_policy
Return mapping

Attach a role to a policy.

Signature:

def attach_role_policy(
        arn: str,
        role_name: str,
        configuration: Dict[str, Dict[str, str]] = None,
        secrets: Dict[str, Dict[str, str]] = None) -> Dict[str, Any]:
    pass

Arguments:

Name Type Default Required
arn string Yes
role_name string Yes

Usage:

{
  "provider": {
    "module": "chaosaws.iam.actions",
    "type": "python",
    "arguments": {
      "role_name": "",
      "arn": ""
    },
    "func": "attach_role_policy"
  },
  "type": "action",
  "name": "attach-role-policy"
}
name: attach-role-policy
provider:
  arguments:
    arn: ''
    role_name: ''
  func: attach_role_policy
  module: chaosaws.iam.actions
  type: python
type: action

create_policy

Type action
Module chaosaws.iam.actions
Name create_policy
Return mapping

Create a new IAM policy

Signature:

def create_policy(name: str,
                  policy: Dict[str, Any],
                  path: str = '/',
                  description: str = '',
                  configuration: Dict[str, Dict[str, str]] = None,
                  secrets: Dict[str, Dict[str, str]] = None) -> Dict[str, Any]:
    pass

Arguments:

Name Type Default Required
name string Yes
policy mapping Yes
path string ”/” No
description string ”“ No

Usage:

{
  "provider": {
    "module": "chaosaws.iam.actions",
    "type": "python",
    "arguments": {
      "policy": {},
      "name": ""
    },
    "func": "create_policy"
  },
  "type": "action",
  "name": "create-policy"
}
name: create-policy
provider:
  arguments:
    name: ''
    policy: {}
  func: create_policy
  module: chaosaws.iam.actions
  type: python
type: action

detach_role_policy

Type action
Module chaosaws.iam.actions
Name detach_role_policy
Return mapping

Detach a role from a policy.

Signature:

def detach_role_policy(
        arn: str,
        role_name: str,
        configuration: Dict[str, Dict[str, str]] = None,
        secrets: Dict[str, Dict[str, str]] = None) -> Dict[str, Any]:
    pass

Arguments:

Name Type Default Required
arn string Yes
role_name string Yes

Usage:

{
  "provider": {
    "module": "chaosaws.iam.actions",
    "type": "python",
    "arguments": {
      "role_name": "",
      "arn": ""
    },
    "func": "detach_role_policy"
  },
  "type": "action",
  "name": "detach-role-policy"
}
name: detach-role-policy
provider:
  arguments:
    arn: ''
    role_name: ''
  func: detach_role_policy
  module: chaosaws.iam.actions
  type: python
type: action

get_policy

Type probe
Module chaosaws.iam.probes
Name get_policy
Return boolean

Get a policy by its ARN

Signature:

def get_policy(arn: str,
               configuration: Dict[str, Dict[str, str]] = None,
               secrets: Dict[str, Dict[str, str]] = None) -> bool:
    pass

Arguments:

Name Type Default Required
arn string Yes

Usage:

{
  "provider": {
    "module": "chaosaws.iam.probes",
    "type": "python",
    "arguments": {
      "arn": ""
    },
    "func": "get_policy"
  },
  "type": "probe",
  "name": "get-policy"
}
name: get-policy
provider:
  arguments:
    arn: ''
  func: get_policy
  module: chaosaws.iam.probes
  type: python
type: probe

eks


create_cluster

Type action
Module chaosaws.eks.actions
Name create_cluster
Return mapping

Create a new EKS cluster.

Signature:

def create_cluster(
        name: str,
        role_arn: str,
        vpc_config: Dict[str, Any],
        version: str = None,
        configuration: Dict[str, Dict[str, str]] = None,
        secrets: Dict[str, Dict[str, str]] = None) -> Dict[str, Any]:
    pass

Arguments:

Name Type Default Required
name string Yes
role_arn string Yes
vpc_config mapping Yes
version string null No

Usage:

{
  "provider": {
    "module": "chaosaws.eks.actions",
    "type": "python",
    "arguments": {
      "role_arn": "",
      "vpc_config": {},
      "name": ""
    },
    "func": "create_cluster"
  },
  "type": "action",
  "name": "create-cluster"
}
name: create-cluster
provider:
  arguments:
    name: ''
    role_arn: ''
    vpc_config: {}
  func: create_cluster
  module: chaosaws.eks.actions
  type: python
type: action

delete_cluster

Type action
Module chaosaws.eks.actions
Name delete_cluster
Return mapping

Delete the given EKS cluster.

Signature:

def delete_cluster(
        name: str = None,
        configuration: Dict[str, Dict[str, str]] = None,
        secrets: Dict[str, Dict[str, str]] = None) -> Dict[str, Any]:
    pass

Arguments:

Name Type Default Required
name string null No

Usage:

{
  "provider": {
    "module": "chaosaws.eks.actions",
    "type": "python",
    "func": "delete_cluster"
  },
  "type": "action",
  "name": "delete-cluster"
}
name: delete-cluster
provider:
  func: delete_cluster
  module: chaosaws.eks.actions
  type: python
type: action

describe_cluster

Type probe
Module chaosaws.eks.probes
Name describe_cluster
Return mapping

Describe an EKS cluster.

Signature:

def describe_cluster(
        name: str,
        configuration: Dict[str, Dict[str, str]] = None,
        secrets: Dict[str, Dict[str, str]] = None) -> Dict[str, Any]:
    pass

Arguments:

Name Type Default Required
name string Yes

Usage:

{
  "provider": {
    "module": "chaosaws.eks.probes",
    "type": "python",
    "arguments": {
      "name": ""
    },
    "func": "describe_cluster"
  },
  "type": "probe",
  "name": "describe-cluster"
}
name: describe-cluster
provider:
  arguments:
    name: ''
  func: describe_cluster
  module: chaosaws.eks.probes
  type: python
type: probe

list_clusters

Type probe
Module chaosaws.eks.probes
Name list_clusters
Return mapping

List EKS clusters available to the authenticated account.

Signature:

def list_clusters(configuration: Dict[str, Dict[str, str]] = None,
                  secrets: Dict[str, Dict[str, str]] = None) -> Dict[str, Any]:
    pass

Arguments:

Name Type Default Required

Usage:

{
  "provider": {
    "module": "chaosaws.eks.probes",
    "type": "python",
    "func": "list_clusters"
  },
  "type": "probe",
  "name": "list-clusters"
}
name: list-clusters
provider:
  func: list_clusters
  module: chaosaws.eks.probes
  type: python
type: probe

ecs


are_all_desired_tasks_running

Type probe
Module chaosaws.ecs.probes
Name are_all_desired_tasks_running
Return boolean

Checks to make sure desired and running tasks counts are equal

Signature:

def are_all_desired_tasks_running(
        cluster: str,
        service: str,
        configuration: Dict[str, Dict[str, str]] = None,
        secrets: Dict[str, Dict[str, str]] = None) -> bool:
    pass

Arguments:

Name Type Default Required
cluster string Yes
service string Yes

Usage:

{
  "provider": {
    "module": "chaosaws.ecs.probes",
    "type": "python",
    "arguments": {
      "service": "",
      "cluster": ""
    },
    "func": "are_all_desired_tasks_running"
  },
  "type": "probe",
  "name": "are-all-desired-tasks-running"
}
name: are-all-desired-tasks-running
provider:
  arguments:
    cluster: ''
    service: ''
  func: are_all_desired_tasks_running
  module: chaosaws.ecs.probes
  type: python
type: probe

delete_cluster

Type action
Module chaosaws.ecs.actions
Name delete_cluster
Return mapping

Delete a given ECS cluster

Signature:

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

Arguments:

Name Type Default Required
cluster string Yes

Usage:

{
  "provider": {
    "module": "chaosaws.ecs.actions",
    "type": "python",
    "arguments": {
      "cluster": ""
    },
    "func": "delete_cluster"
  },
  "type": "action",
  "name": "delete-cluster"
}
name: delete-cluster
provider:
  arguments:
    cluster: ''
  func: delete_cluster
  module: chaosaws.ecs.actions
  type: python
type: action

delete_service

Type action
Module chaosaws.ecs.actions
Name delete_service
Return mapping

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 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.

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

Arguments:

Name Type Default Required
service string null No
cluster string null No
service_pattern string null No

Usage:

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

deregister_container_instance

Type action
Module chaosaws.ecs.actions
Name deregister_container_instance
Return mapping

Deregister a given ECS container. Becareful that tasks handled by this instance will remain orphan.

Signature:

def deregister_container_instance(
        cluster: str,
        instance_id: str,
        force: bool = False,
        configuration: Dict[str, Dict[str, str]] = None,
        secrets: Dict[str, Dict[str, str]] = None) -> Dict[str, Any]:
    pass

Arguments:

Name Type Default Required
cluster string Yes
instance_id string Yes
force boolean false No

Usage:

{
  "provider": {
    "module": "chaosaws.ecs.actions",
    "type": "python",
    "arguments": {
      "cluster": "",
      "instance_id": ""
    },
    "func": "deregister_container_instance"
  },
  "type": "action",
  "name": "deregister-container-instance"
}
name: deregister-container-instance
provider:
  arguments:
    cluster: ''
    instance_id: ''
  func: deregister_container_instance
  module: chaosaws.ecs.actions
  type: python
type: action

service_is_deploying

Type probe
Module chaosaws.ecs.probes
Name service_is_deploying
Return boolean

Checks to make sure there is not an in progress deployment

Signature:

def service_is_deploying(cluster: str,
                         service: str,
                         configuration: Dict[str, Dict[str, str]] = None,
                         secrets: Dict[str, Dict[str, str]] = None) -> bool:
    pass

Arguments:

Name Type Default Required
cluster string Yes
service string Yes

Usage:

{
  "provider": {
    "module": "chaosaws.ecs.probes",
    "type": "python",
    "arguments": {
      "service": "",
      "cluster": ""
    },
    "func": "service_is_deploying"
  },
  "type": "probe",
  "name": "service-is-deploying"
}
name: service-is-deploying
provider:
  arguments:
    cluster: ''
    service: ''
  func: service_is_deploying
  module: chaosaws.ecs.probes
  type: python
type: probe

stop_task

Type action
Module chaosaws.ecs.actions
Name stop_task
Return mapping

Stop a given ECS task instance. If no task_id provided, a random task of the given service is stopped.

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

Signature:

def stop_task(cluster: str = None,
              task_id: str = None,
              service: str = None,
              reason: str = 'Chaos Testing',
              configuration: Dict[str, Dict[str, str]] = None,
              secrets: Dict[str, Dict[str, str]] = None) -> Dict[str, Any]:
    pass

Arguments:

Name Type Default Required
cluster string null No
task_id string null No
service string null No
reason string “Chaos Testing” No

Usage:

{
  "provider": {
    "module": "chaosaws.ecs.actions",
    "type": "python",
    "func": "stop_task"
  },
  "type": "action",
  "name": "stop-task"
}
name: stop-task
provider:
  func: stop_task
  module: chaosaws.ecs.actions
  type: python
type: action