AWS AZ
action AZ:ASG

# fail_az

Simulates the loss of an AZ in an AWS Region for AutoScalingGroups

Run it now
View details

Type | action
Module | azchaosaws.asg.actions
Name | fail_az
Return | mapping

This function simulates the loss of an AZ in an AWS Region for AutoScalingGroups by removing subnets of the AZ in the ASGs or update its min, max and desired capacity to 0 if it’s only configured for scaling in a single AZ. It also suspends the process of AZ Rebalancing of the ASG.

Conflicts with `eks.fail_az`: ensure that ASGs that belong to EKS clusters are not be tagged as they will be captured by this action, which will cause eks fail_az to not be able to identify the worker nodes.

Usage

JSON

    {
      "name": "fail_az",
      "type": "action",
      "provider": {
        "type": "python",
        "module": "azchaosaws.asg.actions",
        "func": "fail_az",
        "arguments": {
          "az": "",
          "dry_run": true
        }
      }
    }

YAML

    name: fail_az
    provider:
      arguments:
        az: ""
        dry_run: true
      func: fail_az
      module: azchaosaws.asg.actions
      type: python
    type: action

Arguments

Name | Type | Default | Required | Title | Description
--- | --- | --- | --- | --- | ---
az | string |  | Yes | Availability Zone | AZ to target
tags | List[Dict[str, str]] | [{"Key": "AZ_FAILURE", "Value": "True"}] | No | Tags | Match only resources with these tags
dry_run | bool | false | No | Dry Run | Only perform a dry run for it

Return structure

    {
      "AvailabilityZone": str,
      "DryRun": bool,
      "AutoScalingGroups": [
        {
          "AutoScalingGroupName": str,
          "Before": {
            "SubnetIds": List[str],
            "AZRebalance": bool,
            "MinSize": int,
            "MaxSize": int,
            "DesiredCapacity": int
          },
          "After": {
            "SubnetIds": List[str],
            "AZRebalance": bool,
            "MinSize": int,
            "MaxSize": int,
            "DesiredCapacity": int
          }
        }
        ...
      ]
    }

Signature

    def fail_az(
        az: str = None,
        dry_run: bool = None,
        tags: List[Dict[str, str]] = [{"Key": "AZ_FAILURE", "Value": "True"}],
        state_path: str = "fail_az.{}.json".format(__package__.split(".", 1)[1]),
        configuration: Configuration = None,
    ) -> Dict[str, Any]:
        pass

## Related starters

- AWS AZ
  action AZ:ASG

  ## `recover_az`

  Rolls back the ASGs that were affected by the fail_az action
- AWS AZ
  action AZ:EC2

  ## `recover_az`

  Rolls back the subnet(s) and/or EC2 instances that were affected by the fail_az action
- AWS AZ
  action AZ:ASG

  ## `recover_az`

  Rolls back the ASGs that were affected by the fail_az action