action AZ:ELBv2

fail_az

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

Run it now
View details
Typeaction
Moduleazchaosaws.elbv2.actions
Namefail_az
Returnmapping

This function simulates the loss of an AZ in an AWS Region for LBs by disabling the failed az subnets in the ALB. Does not support NLBs.

Usage

JSON

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

YAML

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

Arguments

NameTypeDefaultRequiredTitleDescription
azstringYesAvailability ZoneAZ to target
tagsList[Dict[str, str]][{"Key": "AZ_FAILURE", "Value": "True"}]NoTagsMatch only resources with these tags
dry_runboolfalseNoDry RunOnly perform a dry run for it

Required:

  • az (str): An availability zone
  • dry_run (bool): The boolean flag to simulate a dry run or not. Setting to True will only run read-only operations and not make changes to resources. (Accepted values: True | False)

Optional:

  • tags (List[Dict[str, str]]): A list of key-value pairs to filter the ELBv2(s) by. (Default: [{"Key": "AZ_FAILURE", "Value": "True"}])

Return structure

{
  "AvailabilityZone": str,
  "DryRun": bool,
  "LoadBalancers": [
    {
      "LoadBalancerName": str,
      "Type": str,
      "Before": {
        "SubnetIds": List[str]
      },
      "After": {
        "SubnetIds": List[str]
      }
    }
  ]
}

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