Skip to content

Commit 22ef715

Browse files
feat: support multiple public ips on firewall (#135)
Co-authored-by: Jared Holgate <jaredholgate@microsoft.com>
1 parent 021e549 commit 22ef715

File tree

19 files changed

+201
-123
lines changed

19 files changed

+201
-123
lines changed

.github/policies/eventResponder.yml

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@ configuration:
1717
then:
1818
- addLabel:
1919
label: "Needs: Triage :mag:"
20+
- addReply:
21+
reply: |
22+
> [!IMPORTANT]
23+
> **The "Needs: Triage :mag:" label must be removed once the triage process is complete!**
24+
25+
> [!TIP]
26+
> For additional guidance on how to triage this issue/PR, see the [Terraform Issue Triage](https://azure.github.io/Azure-Verified-Modules/help-support/issue-triage/terraform-issue-triage) documentation.
2027
2128
- description: 'ITA09 - When #RR is used in an issue, add the "Needs: Author Feedback :ear:" label'
2229
if:
@@ -47,7 +54,7 @@ configuration:
4754
label: "Status: Won't Fix :broken_heart:"
4855
- closeIssue
4956

50-
- description: 'ITA11 - When a reply from anyone to an issue occurs, remove the "Needs: Author Feedback :ear:" label and label with "Needs: Attention :wave:"'
57+
- description: 'ITA11 - When the author replies, remove the "Needs: Author Feedback :ear:" label and label with "Needs: Attention :wave:"'
5158
if:
5259
- or:
5360
- payloadType: Pull_Request_Review_Comment
@@ -57,9 +64,13 @@ configuration:
5764
action: Closed
5865
- hasLabel:
5966
label: "Needs: Author Feedback :ear:"
67+
- isActivitySender:
68+
issueAuthor: true
6069
then:
6170
- removeLabel:
6271
label: "Needs: Author Feedback :ear:"
72+
- removeLabel:
73+
label: "Status: No Recent Activity :zzz:"
6374
- addLabel:
6475
label: "Needs: Attention :wave:"
6576

@@ -89,12 +100,14 @@ configuration:
89100
label: "Type: New Module Proposal :bulb:"
90101
- hasLabel:
91102
label: "Type: Question/Feedback :raising_hand:"
103+
- hasLabel:
104+
label: "Type: Security Bug :lock:"
92105
- isAssignedToSomeone
93106
then:
94107
- removeLabel:
95108
label: "Needs: Triage :mag:"
96109

97-
- description: 'ITA20 - If the type is feature request, add the "Type: Feature Request :heavy_plus_sign:" label on the issue'
110+
- description: 'ITA20 - If the type is feature request, assign the "Type: Feature Request :heavy_plus_sign:" label on the issue'
98111
if:
99112
- payloadType: Issues
100113
- isAction:
@@ -111,7 +124,7 @@ configuration:
111124
- addLabel:
112125
label: "Type: Feature Request :heavy_plus_sign:"
113126

114-
- description: 'ITA21 - If the type is bug, add the "Type: Bug :bug:" label on the issue'
127+
- description: 'ITA21 - If the type is bug, assign the "Type: Bug :bug:" label on the issue'
115128
if:
116129
- payloadType: Issues
117130
- isAction:
@@ -128,6 +141,23 @@ configuration:
128141
- addLabel:
129142
label: "Type: Bug :bug:"
130143

144+
- description: 'ITA22 - If the type is security bug, assign the "Type: Security Bug :lock:" label on the issue'
145+
if:
146+
- payloadType: Issues
147+
- isAction:
148+
action: Opened
149+
- bodyContains:
150+
pattern: |
151+
### Issue Type?
152+
153+
Security Bug
154+
- not:
155+
hasLabel:
156+
label: "Type: Security Bug :lock:"
157+
then:
158+
- addLabel:
159+
label: "Type: Security Bug :lock:"
160+
131161
- description: 'ITA23 - Remove the "Status: In PR" label from an issue when it''s closed.'
132162
if:
133163
- payloadType: Issues

.github/policies/scheduledSearches.yml

Lines changed: 12 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ configuration:
2323
- isOpen
2424
- hasLabel:
2525
label: "Needs: Triage :mag:"
26+
- isNotLabeledWith:
27+
label: "Status: Response Overdue :triangular_flag_on_post:"
2628
- noActivitySince:
2729
days: 5
2830
actions:
@@ -52,6 +54,8 @@ configuration:
5254
- isOpen
5355
- hasLabel:
5456
label: "Needs: Triage :mag:"
57+
- isNotLabeledWith:
58+
label: "Status: Response Overdue :triangular_flag_on_post:"
5559
- noActivitySince:
5660
days: 3
5761
actions:
@@ -86,6 +90,8 @@ configuration:
8690
- isOpen
8791
- hasLabel:
8892
label: "Status: Response Overdue :triangular_flag_on_post:"
93+
- isNotLabeledWith:
94+
label: "Needs: Immediate Attention :bangbang:"
8995
- noActivitySince:
9096
days: 5
9197
actions:
@@ -102,7 +108,7 @@ configuration:
102108
- addLabel:
103109
label: "Needs: Immediate Attention :bangbang:"
104110

105-
- description: "ITA02TF.2 - Label issues as Needs Immediate Attention and leave comment if after an additional 3 business days there's still no update to the issue."
111+
- description: "ITA02TF.2 - Label and comment issues as Needs Immediate Attention and leave comment if after an additional 3 business days there's still no update to the issue."
106112
frequencies:
107113
- weekday:
108114
day: Thursday
@@ -115,6 +121,8 @@ configuration:
115121
- isOpen
116122
- hasLabel:
117123
label: "Status: Response Overdue :triangular_flag_on_post:"
124+
- isNotLabeledWith:
125+
label: "Needs: Immediate Attention :bangbang:"
118126
- noActivitySince:
119127
days: 3
120128
actions:
@@ -123,7 +131,7 @@ configuration:
123131
- Azure/avm-core-team-technical-terraform
124132
replyTemplate: |
125133
> [!CAUTION]
126-
> **This issue requires the AVM Core Team's (${mentionees}) immediate attention as it hasn't been responded to within 6 business days. **
134+
> **This issue requires the AVM Core Team's (${mentionees}) immediate attention as it hasn't been responded to within 6 business days.**
127135
128136
> [!TIP]
129137
> - To avoid this rule being (re)triggered, the "Needs: Triage :mag:" and "Status: Response Overdue :triangular_flag_on_post:" labels must be removed when the issue is first responded to!
@@ -175,12 +183,11 @@ configuration:
175183
- assignTo:
176184
user: Azure/terraform-avm
177185

178-
- description: "ITA04 - Label issues that have been marked as requiring author feedback but have not had any activity for 4 days."
186+
- description: "ITA04 - Label issues and PRs that have been marked as requiring author feedback but have not had any activity for 4 days."
179187
frequencies:
180188
- hourly:
181189
hour: 3
182190
filters:
183-
- isIssue
184191
- isOpen
185192
- hasLabel:
186193
label: "Needs: Author Feedback :ear:"
@@ -196,48 +203,4 @@ configuration:
196203
- addReply:
197204
reply: |
198205
> [!IMPORTANT]
199-
> @${issueAuthor}, this issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **4 days**. It will be closed if no further activity occurs **within 3 days of this comment**.
200-
201-
- description: 'ITA05A - Close issues that have been marked as requiring author feedback but have not had any activity for 3 days, unless it''s been marked with the "Status long term" label.'
202-
frequencies:
203-
- hourly:
204-
hour: 3
205-
filters:
206-
- isIssue
207-
- isOpen
208-
- hasLabel:
209-
label: "Needs: Author Feedback :ear:"
210-
- hasLabel:
211-
label: "Status: No Recent Activity :zzz:"
212-
- isNotLabeledWith:
213-
label: "Needs: Module Owner :mega:"
214-
- noActivitySince:
215-
days: 3
216-
actions:
217-
- addReply:
218-
reply: |
219-
> [!WARNING]
220-
> @${issueAuthor}, this issue will now be closed, as it has been marked as requiring author feedback but has not had any activity for **7 days**.
221-
- closeIssue
222-
223-
- description: 'ITA05B - Close issues that have been marked as requiring author feedback but have not had any activity for 3 days, unless it''s been marked with the "Status long term" label.'
224-
frequencies:
225-
- hourly:
226-
hour: 3
227-
filters:
228-
- isIssue
229-
- isOpen
230-
- hasLabel:
231-
label: "Needs: Author Feedback :ear:"
232-
- hasLabel:
233-
label: "Status: No Recent Activity :zzz:"
234-
- isNotLabeledWith:
235-
label: "Status: Long Term :hourglass_flowing_sand:"
236-
- noActivitySince:
237-
days: 3
238-
actions:
239-
- addReply:
240-
reply: |
241-
> [!WARNING]
242-
> @${issueAuthor}, this issue will now be closed, as it has been marked as requiring author feedback but has not had any activity for **7 days**.
243-
- closeIssue
206+
> @${issueAuthor}, this issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **4 days**.

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,13 +177,20 @@ Description: A map of the hub virtual networks to create. The map key is an arbi
177177
- `subnet_route_table_id` = (Optional) The resource id of the Route Table which should be associated with the Azure Firewall subnet. If not specified the module will assign the generated route table.
178178
- `tags` - (Optional) A map of tags to apply to the Azure Firewall. If not specified
179179
- `zones` - (Optional) A list of availability zones to use for the Azure Firewall. If not specified will be `null`.
180-
- `default_ip_configuration` - (Optional) An object with the following fields. If not specified the defaults below will be used:
180+
- `default_ip_configuration` - (Optional) An object with the following fields. This is for legacy purpose, consider using `ip_configurations` instead. If not specified the defaults below will be used:
181181
- `name` - (Optional) The name of the default IP configuration. If not specified will use `default`.
182182
- `public_ip_config` - (Optional) An object with the following fields:
183183
- `name` - (Optional) The name of the public IP configuration. If not specified will use `pip-fw-{vnetname}`.
184184
- `zones` - (Optional) A list of availability zones to use for the public IP configuration. If not specified will be `null`.
185185
- `ip_version` - (Optional) The IP version to use for the public IP configuration. Possible values include `IPv4`, `IPv6`. If not specified will be `IPv4`.
186186
- `sku_tier` - (Optional) The SKU tier to use for the public IP configuration. Possible values include `Regional`, `Global`. If not specified will be `Regional`.
187+
- `ip_configurations` - (Optional) A map of the default IP configuration for the Azure Firewall. If not specified the defaults below will be used:
188+
- `name` - (Optional) The name of the default IP configuration. If not specified will use `default`.
189+
- `public_ip_config` - (Optional) An object with the following fields:
190+
- `name` - (Optional) The name of the public IP configuration. If not specified will use `pip-fw-{vnetname}-<Map Key>`.
191+
- `zones` - (Optional) A list of availability zones to use for the public IP configuration. If not specified will be `null`.
192+
- `ip_version` - (Optional) The IP version to use for the public IP configuration. Possible values include `IPv4`, `IPv6`. If not specified will be `IPv4`.
193+
- `sku_tier` - (Optional) The SKU tier to use for the public IP configuration. Possible values include `Regional`, `Global`. If not specified will be `Regional`.
187194
- `management_ip_configuration` - (Optional) An object with the following fields. If not specified the defaults below will be used:
188195
- `name` - (Optional) The name of the management IP configuration. If not specified will use `defaultMgmt`.
189196
- `public_ip_config` - (Optional) An object with the following fields:
@@ -303,6 +310,15 @@ map(object({
303310
zones = optional(set(string))
304311
}))
305312
}))
313+
ip_configurations = optional(map(object({
314+
name = optional(string)
315+
public_ip_config = optional(object({
316+
ip_version = optional(string, "IPv4")
317+
name = optional(string)
318+
sku_tier = optional(string, "Regional")
319+
zones = optional(set(string))
320+
}))
321+
})))
306322
management_ip_configuration = optional(object({
307323
name = optional(string)
308324
public_ip_config = optional(object({

SUPPORT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
This project uses GitHub Issues to track bugs and feature requests. Please search the existing issues before filing new issues to avoid duplicates. For new issues, file your bug or feature request as a new issue.
88

9-
Issues can be created and searched through for existing [issues here](https://github.com/Azure/terraform-azurerm-avm-ptn-hubnetworking/issues).
9+
Issues can be created and searched through for existing [issues here](../../issues).
1010

1111
Please provide as much information as possible when filing an issue. Include screenshots or correlation IDs if possible (please redact any sensitive information).
1212

avm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ if [ ! "$(command -v "$CONTAINER_RUNTIME")" ]; then
1111
exit 1
1212
fi
1313

14+
AVM_IMAGE=${AVM_IMAGE:-mcr.microsoft.com/azterraform}
15+
1416
if [ -z "$1" ]; then
1517
echo "Error: Please provide a make target. See https://github.com/Azure/tfmod-scaffold/blob/main/avmmakefile for available targets."
1618
echo
@@ -26,7 +28,7 @@ fi
2628
# Check if we are running in a container
2729
# If we are then just run make directly
2830
if [ -z "$AVM_IN_CONTAINER" ]; then
29-
$CONTAINER_RUNTIME run --pull always --user "$(id -u):$(id -g)" --rm -v "$(pwd)":/src -w /src -v $AZURE_CONFIG_DIR:/azureconfig -e AZURE_CONFIG_DIR=/azureconfig -e GITHUB_TOKEN -e GITHUB_REPOSITORY -e ARM_SUBSCRIPTION_ID -e ARM_TENANT_ID -e ARM_CLIENT_ID -e GITHUB_REPOSITORY_OWNER mcr.microsoft.com/azterraform make "$1"
31+
$CONTAINER_RUNTIME run --pull always --user "$(id -u):$(id -g)" --rm -v "$(pwd)":/src -w /src -v $AZURE_CONFIG_DIR:/azureconfig -e AZURE_CONFIG_DIR=/azureconfig -e GITHUB_TOKEN -e GITHUB_REPOSITORY -e ARM_SUBSCRIPTION_ID -e ARM_TENANT_ID -e ARM_CLIENT_ID -e GITHUB_REPOSITORY_OWNER $AVM_IMAGE make "$1"
3032
else
3133
make "$1"
3234
fi

avm.bat

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,21 @@ IF ERRORLEVEL 1 (
1111
exit /b
1212
)
1313

14+
IF DEFINED AVM_IMAGE (SET "AVM_IMAGE=%AVM_IMAGE%") ELSE (SET "AVM_IMAGE=mcr.microsoft.com/azterraform")
15+
1416
REM Check if a make target is provided
1517
IF "%~1"=="" (
1618
echo Error: Please provide a make target. See https://github.com/Azure/tfmod-scaffold/blob/main/avmmakefile for available targets.
1719
exit /b
1820
)
1921

22+
IF DEFINED NO_PULL (
23+
SET "PULL_ARG="
24+
) ELSE (
25+
SET "PULL_ARG=--pull always"
26+
)
27+
2028
REM Run the make target with CONTAINER_RUNTIME
21-
%CONTAINER_RUNTIME% run --pull always --rm -v "%cd%":/src -w /src --user "1000:1000" -e GITHUB_TOKEN -e ARM_SUBSCRIPTION_ID -e ARM_TENANT_ID -e ARM_CLIENT_ID -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER mcr.microsoft.com/azterraform make %1
29+
%CONTAINER_RUNTIME% run %PULL_ARG% --rm -v "%cd%":/src -w /src --user "1000:1000" -e GITHUB_TOKEN -e ARM_SUBSCRIPTION_ID -e ARM_TENANT_ID -e ARM_CLIENT_ID -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER %AVM_IMAGE% make %1
2230

2331
ENDLOCAL

examples/azure_landing_zone_firewall/README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ module "hub_mesh" {
7676
sku_tier = "Standard"
7777
zones = ["1", "2", "3"]
7878
default_ip_configuration = {
79+
#name = "primary-pip"
7980
public_ip_config = {
8081
name = "pip-fw-hub-primary"
8182
zones = ["1", "2", "3"]
@@ -142,10 +143,12 @@ module "hub_mesh" {
142143
sku_name = "AZFW_VNet"
143144
sku_tier = "Standard"
144145
zones = ["1", "2", "3"]
145-
default_ip_configuration = {
146-
public_ip_config = {
147-
name = "pip-fw-hub-secondary"
148-
zones = ["1", "2", "3"]
146+
ip_configurations = {
147+
default = {
148+
public_ip_config = {
149+
name = "pip-fw-hub-secondary"
150+
zones = ["1", "2", "3"]
151+
}
149152
}
150153
}
151154
management_ip_enabled = false

examples/azure_landing_zone_firewall/main.tf

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ module "hub_mesh" {
7070
sku_tier = "Standard"
7171
zones = ["1", "2", "3"]
7272
default_ip_configuration = {
73+
#name = "primary-pip"
7374
public_ip_config = {
7475
name = "pip-fw-hub-primary"
7576
zones = ["1", "2", "3"]
@@ -136,10 +137,12 @@ module "hub_mesh" {
136137
sku_name = "AZFW_VNet"
137138
sku_tier = "Standard"
138139
zones = ["1", "2", "3"]
139-
default_ip_configuration = {
140-
public_ip_config = {
141-
name = "pip-fw-hub-secondary"
142-
zones = ["1", "2", "3"]
140+
ip_configurations = {
141+
default = {
142+
public_ip_config = {
143+
name = "pip-fw-hub-secondary"
144+
zones = ["1", "2", "3"]
145+
}
143146
}
144147
}
145148
management_ip_enabled = false

examples/basic/README.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,20 @@ module "hub" {
5151
sku_tier = "Standard"
5252
subnet_address_prefix = "10.0.1.0/24"
5353
management_subnet_address_prefix = "10.0.2.0/24"
54-
default_ip_configuration = {
55-
public_ip_config = {
56-
zones = ["1", "2", "3"]
54+
ip_configurations = {
55+
primary = {
56+
name = "primary-ip-config"
57+
public_ip_config = {
58+
name = "pip-hub-primary-1"
59+
zones = ["1", "2", "3"]
60+
}
61+
}
62+
secondary = {
63+
name = "secondary-ip-config"
64+
public_ip_config = {
65+
name = "pip-hub-secondary-2"
66+
zones = ["1", "2", "3"]
67+
}
5768
}
5869
}
5970
management_ip_configuration = {
@@ -71,11 +82,6 @@ module "hub" {
7182
}
7283
}
7384
}
74-
75-
76-
77-
78-
7985
```
8086

8187
<!-- markdownlint-disable MD033 -->
@@ -129,7 +135,7 @@ The following outputs are exported:
129135

130136
Description: n/a
131137

132-
### <a name="output_firewall_ip_address"></a> [firewall\_ip\_address](#output\_firewall\_ip\_address)
138+
### <a name="output_firewall_ip_addresses"></a> [firewall\_ip\_addresses](#output\_firewall\_ip\_addresses)
133139

134140
Description: n/a
135141

0 commit comments

Comments
 (0)