Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/zones/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/zones/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions src/zones/azext_zones/_argHelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/zones/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading