diff --git a/src/zones/HISTORY.rst b/src/zones/HISTORY.rst index 9910bd4c279..89daceeff13 100644 --- a/src/zones/HISTORY.rst +++ b/src/zones/HISTORY.rst @@ -3,6 +3,14 @@ Release History =============== +1.0.0b4 +++++++ +* Force resource group input to lowercase for comparison with ARG results +* Added support for the following resource types: + - NAT Gateways + - Public IP Prefixes + - Container Apps Jobs + 1.0.0b3 ++++++ * Minor bugfixes to improve command loading diff --git a/src/zones/README.md b/src/zones/README.md index a8abb2dcbe1..556ed4dfa02 100644 --- a/src/zones/README.md +++ b/src/zones/README.md @@ -58,7 +58,7 @@ Omit 'dependent' resources from the output. These are resources that by themselv az zones validate --omit-dependent-resources ``` -Validate all resources with specific tags. Resources that have ALL specified tags will be returned +Validate all resources with specific tags. Resources that have ALL specified tags will be returned. Tags are case-sensitive. ```bash az zones validate --tags env=prod,criticality=high diff --git a/src/zones/azext_zones/_argHelper.py b/src/zones/azext_zones/_argHelper.py index c2b79298927..4c60616bbb0 100644 --- a/src/zones/azext_zones/_argHelper.py +++ b/src/zones/azext_zones/_argHelper.py @@ -25,6 +25,9 @@ def build_arg_query(resource_groups, tags): query = "Resources" if resource_groups is not None and len(resource_groups) > 0: + # ARG returns all resource groups as lowercase, so we need to lowercase the input + resource_groups = resource_groups.lower() + query += " | where resourceGroup in ({0})".format(','.join(f"'{item}'" for item in resource_groups.split(','))) if tags is not None: diff --git a/src/zones/azext_zones/resource_type_validators/microsoft_app.py b/src/zones/azext_zones/resource_type_validators/microsoft_app.py index 7a11df01f31..eb10249dc89 100644 --- a/src/zones/azext_zones/resource_type_validators/microsoft_app.py +++ b/src/zones/azext_zones/resource_type_validators/microsoft_app.py @@ -27,6 +27,12 @@ def validate(resource): # zone redundant managedEnvironment return ZoneRedundancyValidationResult.Dependent + # Container App Jobs + if resourceSubType == "jobs": + # Jobs are zone redundant if they are hosted on a + # zone redundant managedEnvironment + return ZoneRedundancyValidationResult.Dependent + # Container Apps Environments if resourceSubType == "managedenvironments": # Managed Environments are zone redundant if the zoneRedundant property is set to true diff --git a/src/zones/azext_zones/resource_type_validators/microsoft_network.py b/src/zones/azext_zones/resource_type_validators/microsoft_network.py index 382d7d7ac49..560fe6fd4bd 100644 --- a/src/zones/azext_zones/resource_type_validators/microsoft_network.py +++ b/src/zones/azext_zones/resource_type_validators/microsoft_network.py @@ -67,6 +67,13 @@ def validate(resource): # pylint: disable=too-many-return-statements,too-many-b # Gateway return ZoneRedundancyValidationResult.Dependent + # NAT Gateways + if resourceSubType == "natgateways": + zones = resource.get("zones") or [] + if len(zones) > 1: + return ZoneRedundancyValidationResult.Yes + return ZoneRedundancyValidationResult.No + # Network Interfaces if resourceSubType == "networkinterfaces": # Network interfaces are in the zone of the virtual machines @@ -107,6 +114,13 @@ def validate(resource): # pylint: disable=too-many-return-statements,too-many-b return ZoneRedundancyValidationResult.Yes return ZoneRedundancyValidationResult.No + # Public IP Prefixes + if resourceSubType == "publicipprefixes": + zones = resource.get("zones") or [] + if len(zones) > 1: + return ZoneRedundancyValidationResult.Yes + return ZoneRedundancyValidationResult.No + # Virtual Networks if resourceSubType == "virtualnetworks": # Virtual networks span all availability zones in a region. diff --git a/src/zones/setup.py b/src/zones/setup.py index 86ceed198dd..91fd50d8470 100644 --- a/src/zones/setup.py +++ b/src/zones/setup.py @@ -14,7 +14,7 @@ from distutils import log as logger logger.warn("Wheel is not available, disabling bdist_wheel hook") -VERSION = '1.0.0b3' +VERSION = '1.0.0b4' # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers