Skip to content

Commit 4debd03

Browse files
authored
{zones} new resource types & bugfix - version 1.0.0b4 (#8820)
1 parent b33d716 commit 4debd03

File tree

6 files changed

+33
-2
lines changed

6 files changed

+33
-2
lines changed

src/zones/HISTORY.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
Release History
44
===============
55

6+
1.0.0b4
7+
++++++
8+
* Force resource group input to lowercase for comparison with ARG results
9+
* Added support for the following resource types:
10+
- NAT Gateways
11+
- Public IP Prefixes
12+
- Container Apps Jobs
13+
614
1.0.0b3
715
++++++
816
* Minor bugfixes to improve command loading

src/zones/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ Omit 'dependent' resources from the output. These are resources that by themselv
5858
az zones validate --omit-dependent-resources
5959
```
6060

61-
Validate all resources with specific tags. Resources that have ALL specified tags will be returned
61+
Validate all resources with specific tags. Resources that have ALL specified tags will be returned. Tags are case-sensitive.
6262

6363
```bash
6464
az zones validate --tags env=prod,criticality=high

src/zones/azext_zones/_argHelper.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ def build_arg_query(resource_groups, tags):
2525

2626
query = "Resources"
2727
if resource_groups is not None and len(resource_groups) > 0:
28+
# ARG returns all resource groups as lowercase, so we need to lowercase the input
29+
resource_groups = resource_groups.lower()
30+
2831
query += " | where resourceGroup in ({0})".format(','.join(f"'{item}'" for item in resource_groups.split(',')))
2932

3033
if tags is not None:

src/zones/azext_zones/resource_type_validators/microsoft_app.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ def validate(resource):
2727
# zone redundant managedEnvironment
2828
return ZoneRedundancyValidationResult.Dependent
2929

30+
# Container App Jobs
31+
if resourceSubType == "jobs":
32+
# Jobs are zone redundant if they are hosted on a
33+
# zone redundant managedEnvironment
34+
return ZoneRedundancyValidationResult.Dependent
35+
3036
# Container Apps Environments
3137
if resourceSubType == "managedenvironments":
3238
# Managed Environments are zone redundant if the zoneRedundant property is set to true

src/zones/azext_zones/resource_type_validators/microsoft_network.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,13 @@ def validate(resource): # pylint: disable=too-many-return-statements,too-many-b
6767
# Gateway
6868
return ZoneRedundancyValidationResult.Dependent
6969

70+
# NAT Gateways
71+
if resourceSubType == "natgateways":
72+
zones = resource.get("zones") or []
73+
if len(zones) > 1:
74+
return ZoneRedundancyValidationResult.Yes
75+
return ZoneRedundancyValidationResult.No
76+
7077
# Network Interfaces
7178
if resourceSubType == "networkinterfaces":
7279
# 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
107114
return ZoneRedundancyValidationResult.Yes
108115
return ZoneRedundancyValidationResult.No
109116

117+
# Public IP Prefixes
118+
if resourceSubType == "publicipprefixes":
119+
zones = resource.get("zones") or []
120+
if len(zones) > 1:
121+
return ZoneRedundancyValidationResult.Yes
122+
return ZoneRedundancyValidationResult.No
123+
110124
# Virtual Networks
111125
if resourceSubType == "virtualnetworks":
112126
# Virtual networks span all availability zones in a region.

src/zones/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from distutils import log as logger
1515
logger.warn("Wheel is not available, disabling bdist_wheel hook")
1616

17-
VERSION = '1.0.0b3'
17+
VERSION = '1.0.0b4'
1818

1919
# The full list of classifiers is available at
2020
# https://pypi.python.org/pypi?%3Aaction=list_classifiers

0 commit comments

Comments
 (0)