-
Notifications
You must be signed in to change notification settings - Fork 437
[Modules] Connect Azure Firewall to a VirtualHub #2395
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
fblix
merged 19 commits into
main
from
users/fblix_jpeasier/1627-azure-firewalls-to-virtual-hubs
Jan 9, 2023
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
ae04da4
init
JPEasier 4e3d08a
added notes to specific azure firewall setup
c48cdba
Merge branch 'users/fblix_jpeasier/1627-azure-firewalls-to-virtual-hu…
d8ca725
implement vhub
JPEasier 6802d10
Merge branch 'users/fblix_jpeasier/1627-azure-firewalls-to-virtual-hu…
JPEasier 5a22889
changed sku based on vnet config
4feefbf
update properties
JPEasier c360aeb
Merge branch 'users/fblix_jpeasier/1627-azure-firewalls-to-virtual-hu…
JPEasier a7db457
Update bicep configuration
JPEasier c31e93f
separated firewallproperties to var
93e2e4b
fixed output
d6c2064
Update outputs
JPEasier 341e612
Merge branch 'users/fblix_jpeasier/1627-azure-firewalls-to-virtual-hu…
JPEasier 48d7489
namePrifix
JPEasier 05ed436
update readme
JPEasier 480946d
update readme
JPEasier 876fc19
updated dependency naming
6333b03
updated readme
1de867a
removed variable
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
modules/Microsoft.Network/azureFirewalls/.test/hub/dependencies.bicep
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| @description('Optional. The location to deploy to.') | ||
| param location string = resourceGroup().location | ||
|
|
||
| param virtualWanName string | ||
|
|
||
| param virtualHubName string | ||
|
|
||
| param firewallPolicyName string | ||
|
|
||
| resource virtualWan 'Microsoft.Network/virtualWans@2021-08-01' = { | ||
| name: virtualWanName | ||
| location: location | ||
| properties: { | ||
| disableVpnEncryption: false | ||
| allowBranchToBranchTraffic: true | ||
| type: 'Standard' | ||
| } | ||
| } | ||
|
|
||
| resource virtualHub 'Microsoft.Network/virtualHubs@2021-08-01' = { | ||
| name: virtualHubName | ||
| location: location | ||
| properties: { | ||
| addressPrefix: '10.1.0.0/16' | ||
| virtualWan: { | ||
| id: virtualWan.id | ||
| } | ||
| } | ||
| } | ||
|
|
||
| resource policy 'Microsoft.Network/firewallPolicies@2021-08-01' = { | ||
| name: firewallPolicyName | ||
| location: location | ||
| properties: { | ||
| threatIntelMode: 'Alert' | ||
| } | ||
| } | ||
|
|
||
| @description('The resource ID of the created Virtual Hub.') | ||
| output virtualHubResourceId string = virtualHub.id | ||
|
|
||
| @description('The resource ID of the created Firewall Policie.') | ||
| output firewallPolicyResourceId string = policy.id | ||
58 changes: 58 additions & 0 deletions
58
modules/Microsoft.Network/azureFirewalls/.test/hub/deploy.test.bicep
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| targetScope = 'subscription' | ||
|
|
||
| // ========== // | ||
| // Parameters // | ||
| // ========== // | ||
| @description('Optional. The name of the resource group to deploy for a testing purposes.') | ||
| @maxLength(90) | ||
| param resourceGroupName string = 'ms.network.azurefirewalls-${serviceShort}-rg' | ||
|
|
||
| @description('Optional. The location to deploy resources to.') | ||
| param location string = deployment().location | ||
|
|
||
| @description('Optional. A short identifier for the kind of deployment. Should be kept short to not run into resource-name length-constraints.') | ||
| param serviceShort string = 'nafhub' | ||
|
|
||
| @description('Optional. Enable telemetry via a Globally Unique Identifier (GUID).') | ||
| param enableDefaultTelemetry bool = true | ||
|
|
||
| // =========== // | ||
| // Deployments // | ||
| // =========== // | ||
|
|
||
| // General resources | ||
| // ================= | ||
| resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = { | ||
| name: resourceGroupName | ||
| location: location | ||
| } | ||
|
|
||
| module resourceGroupResources 'dependencies.bicep' = { | ||
| scope: resourceGroup | ||
| name: '${uniqueString(deployment().name, location)}-paramNested' | ||
| params: { | ||
| virtualWanName: 'dep-<<namePrefix>>-vwan-${serviceShort}' | ||
| virtualHubName: 'dep-<<namePrefix>>-vhub-${serviceShort}' | ||
| firewallPolicyName: 'dep-<<namePrefix>>-afwp-${serviceShort}' | ||
| } | ||
| } | ||
|
|
||
| // ============== // | ||
| // Test Execution // | ||
| // ============== // | ||
|
|
||
| module testDeployment '../../deploy.bicep' = { | ||
| scope: resourceGroup | ||
| name: '${uniqueString(deployment().name)}-test-${serviceShort}' | ||
| params: { | ||
| enableDefaultTelemetry: enableDefaultTelemetry | ||
| name: '<<namePrefix>>${serviceShort}001' | ||
| firewallPolicyId: resourceGroupResources.outputs.firewallPolicyResourceId | ||
| virtualHubId: resourceGroupResources.outputs.virtualHubResourceId | ||
| hubIPAddresses: { | ||
| publicIPs: { | ||
| count: 1 | ||
| } | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.