Skip to content

Commit b030b92

Browse files
authored
Azure Firewall Autoscale Configuration (#9235)
* Azure Firewall Autoscale Configuration * bump version * update recordings for tests * reset of recordings * Try to fix recording for test_azure_firewall_policy_explicit_proxy * non-dynamic test value * Use sas token key * Remove explicit proxy test
1 parent e761a75 commit b030b92

File tree

39 files changed

+31278
-20312
lines changed

39 files changed

+31278
-20312
lines changed

src/azure-firewall/HISTORY.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
33
Release History
44
===============
5+
1.4.0
6+
++++++
7+
* `az network firewall create`: Add parameters `--min-capacity` and `--max-capacity` to support autoscale configuration
8+
59
1.3.0
610
++++++
711
* `az network firewall create`: Add parameter `--edge-zone` to support extended location

src/azure-firewall/azext_firewall/aaz/latest/network/firewall/_create.py

Lines changed: 50 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ class Create(AAZCommand):
2828
2929
:example: Create a Basic SKU Firewall with Virtual Hub
3030
az network firewall create -g MyResourceGroup -n MyFirewall --sku AZFW_Hub --tier Basic --vhub MyVHub --public-ip-count 2
31+
32+
:example: Create Azure Firewall With AutoscaleConfiguration
33+
az network firewall create -g MyResourceGroup -n MyFirewall --min-capacity 4
34+
az network firewall create -g MyResourceGroup -n MyFirewall --min-capacity 10 --max-capacity 10
3135
"""
3236

3337
_aaz_info = {
@@ -66,10 +70,6 @@ def _build_arguments_schema(cls, *args, **kwargs):
6670
_args_schema.resource_group = AAZResourceGroupNameArg(
6771
required=True,
6872
)
69-
_args_schema.extended_location = AAZObjectArg(
70-
options=["--extended-location"],
71-
help="The extended location of type local virtual network gateway.",
72-
)
7373
_args_schema.location = AAZResourceLocationArg(
7474
help="Resource location.",
7575
fmt=AAZResourceLocationArgFormat(
@@ -109,23 +109,34 @@ def _build_arguments_schema(cls, *args, **kwargs):
109109
help="Space-separated list of availability zones into which to provision the resource. Allowed values: 1, 2, 3.",
110110
)
111111

112-
extended_location = cls._args_schema.extended_location
113-
extended_location.name = AAZStrArg(
114-
options=["name"],
115-
help="The name of the extended location.",
116-
)
117-
extended_location.type = AAZStrArg(
118-
options=["type"],
119-
help="The type of the extended location.",
120-
enum={"EdgeZone": "EdgeZone"},
121-
)
122-
123112
tags = cls._args_schema.tags
124113
tags.Element = AAZStrArg()
125114

126115
zones = cls._args_schema.zones
127116
zones.Element = AAZStrArg()
128117

118+
# define Arg Group "AutoscaleConfiguration"
119+
120+
_args_schema = cls._args_schema
121+
_args_schema.max_capacity = AAZIntArg(
122+
options=["--max-capacity"],
123+
arg_group="AutoscaleConfiguration",
124+
help="The maximum number of capacity units for this azure firewall. Use null to reset the value to the service default.",
125+
nullable=True,
126+
fmt=AAZIntArgFormat(
127+
minimum=2,
128+
),
129+
)
130+
_args_schema.min_capacity = AAZIntArg(
131+
options=["--min-capacity"],
132+
arg_group="AutoscaleConfiguration",
133+
help="The minimum number of capacity units for this azure firewall. Use null to reset the value to the service default.",
134+
nullable=True,
135+
fmt=AAZIntArgFormat(
136+
minimum=2,
137+
),
138+
)
139+
129140
# define Arg Group "HubIpAddresses"
130141

131142
# define Arg Group "Management IP Configuration"
@@ -151,6 +162,24 @@ def _build_arguments_schema(cls, *args, **kwargs):
151162

152163
# define Arg Group "Parameters"
153164

165+
_args_schema = cls._args_schema
166+
_args_schema.extended_location = AAZObjectArg(
167+
options=["--extended-location"],
168+
arg_group="Parameters",
169+
help="The extended location of type local virtual network gateway.",
170+
)
171+
172+
extended_location = cls._args_schema.extended_location
173+
extended_location.name = AAZStrArg(
174+
options=["name"],
175+
help="The name of the extended location.",
176+
)
177+
extended_location.type = AAZStrArg(
178+
options=["type"],
179+
help="The type of the extended location.",
180+
enum={"EdgeZone": "EdgeZone"},
181+
)
182+
154183
# define Arg Group "Properties"
155184

156185
_args_schema = cls._args_schema
@@ -351,6 +380,7 @@ def content(self):
351380
properties = _builder.get(".properties")
352381
if properties is not None:
353382
properties.set_prop("additionalProperties", AAZDictType, ".additional_properties")
383+
properties.set_prop("autoscaleConfiguration", AAZObjectType)
354384
properties.set_prop("firewallPolicy", AAZObjectType)
355385
properties.set_prop("hubIPAddresses", AAZObjectType)
356386
properties.set_prop("ipConfigurations", AAZListType, ".ip_configurations")
@@ -363,6 +393,11 @@ def content(self):
363393
if additional_properties is not None:
364394
additional_properties.set_elements(AAZStrType, ".")
365395

396+
autoscale_configuration = _builder.get(".properties.autoscaleConfiguration")
397+
if autoscale_configuration is not None:
398+
autoscale_configuration.set_prop("maxCapacity", AAZIntType, ".max_capacity", typ_kwargs={"nullable": True})
399+
autoscale_configuration.set_prop("minCapacity", AAZIntType, ".min_capacity", typ_kwargs={"nullable": True})
400+
366401
firewall_policy = _builder.get(".properties.firewallPolicy")
367402
if firewall_policy is not None:
368403
firewall_policy.set_prop("id", AAZStrType, ".firewall_policy")

src/azure-firewall/azext_firewall/aaz/latest/network/firewall/_update.py

Lines changed: 49 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,6 @@ def _build_arguments_schema(cls, *args, **kwargs):
5353
_args_schema.resource_group = AAZResourceGroupNameArg(
5454
required=True,
5555
)
56-
_args_schema.extended_location = AAZObjectArg(
57-
options=["--extended-location"],
58-
help="The extended location of type local virtual network gateway.",
59-
nullable=True,
60-
)
6156
_args_schema.firewall_policy = AAZStrArg(
6257
options=["--policy", "--firewall-policy"],
6358
help="Name or ID of the firewallPolicy associated with this azure firewall.",
@@ -85,19 +80,6 @@ def _build_arguments_schema(cls, *args, **kwargs):
8580
nullable=True,
8681
)
8782

88-
extended_location = cls._args_schema.extended_location
89-
extended_location.name = AAZStrArg(
90-
options=["name"],
91-
help="The name of the extended location.",
92-
nullable=True,
93-
)
94-
extended_location.type = AAZStrArg(
95-
options=["type"],
96-
help="The type of the extended location.",
97-
nullable=True,
98-
enum={"EdgeZone": "EdgeZone"},
99-
)
100-
10183
tags = cls._args_schema.tags
10284
tags.Element = AAZStrArg(
10385
nullable=True,
@@ -108,6 +90,28 @@ def _build_arguments_schema(cls, *args, **kwargs):
10890
nullable=True,
10991
)
11092

93+
# define Arg Group "AutoscaleConfiguration"
94+
95+
_args_schema = cls._args_schema
96+
_args_schema.max_capacity = AAZIntArg(
97+
options=["--max-capacity"],
98+
arg_group="AutoscaleConfiguration",
99+
help="The maximum number of capacity units for this azure firewall. Use null to reset the value to the service default.",
100+
nullable=True,
101+
fmt=AAZIntArgFormat(
102+
minimum=2,
103+
),
104+
)
105+
_args_schema.min_capacity = AAZIntArg(
106+
options=["--min-capacity"],
107+
arg_group="AutoscaleConfiguration",
108+
help="The minimum number of capacity units for this azure firewall. Use null to reset the value to the service default.",
109+
nullable=True,
110+
fmt=AAZIntArgFormat(
111+
minimum=2,
112+
),
113+
)
114+
111115
# define Arg Group "HubIpAddresses"
112116

113117
_args_schema = cls._args_schema
@@ -132,6 +136,27 @@ def _build_arguments_schema(cls, *args, **kwargs):
132136

133137
# define Arg Group "Parameters"
134138

139+
_args_schema = cls._args_schema
140+
_args_schema.extended_location = AAZObjectArg(
141+
options=["--extended-location"],
142+
arg_group="Parameters",
143+
help="The extended location of type local virtual network gateway.",
144+
nullable=True,
145+
)
146+
147+
extended_location = cls._args_schema.extended_location
148+
extended_location.name = AAZStrArg(
149+
options=["name"],
150+
help="The name of the extended location.",
151+
nullable=True,
152+
)
153+
extended_location.type = AAZStrArg(
154+
options=["type"],
155+
help="The type of the extended location.",
156+
nullable=True,
157+
enum={"EdgeZone": "EdgeZone"},
158+
)
159+
135160
# define Arg Group "Properties"
136161

137162
_args_schema = cls._args_schema
@@ -478,6 +503,7 @@ def _update_instance(self, instance):
478503
properties = _builder.get(".properties")
479504
if properties is not None:
480505
properties.set_prop("additionalProperties", AAZDictType, ".additional_properties")
506+
properties.set_prop("autoscaleConfiguration", AAZObjectType)
481507
properties.set_prop("firewallPolicy", AAZObjectType)
482508
properties.set_prop("hubIPAddresses", AAZObjectType)
483509
properties.set_prop("sku", AAZObjectType)
@@ -488,6 +514,11 @@ def _update_instance(self, instance):
488514
if additional_properties is not None:
489515
additional_properties.set_elements(AAZStrType, ".")
490516

517+
autoscale_configuration = _builder.get(".properties.autoscaleConfiguration")
518+
if autoscale_configuration is not None:
519+
autoscale_configuration.set_prop("maxCapacity", AAZIntType, ".max_capacity", typ_kwargs={"nullable": True})
520+
autoscale_configuration.set_prop("minCapacity", AAZIntType, ".min_capacity", typ_kwargs={"nullable": True})
521+
491522
firewall_policy = _builder.get(".properties.firewallPolicy")
492523
if firewall_policy is not None:
493524
firewall_policy.set_prop("id", AAZStrType, ".firewall_policy")
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"azext.minCliCoreVersion": "2.67.0"
2+
"azext.minCliCoreVersion": "2.75.0"
33
}

0 commit comments

Comments
 (0)