Spoke Networking

br/innofactor:avm/ptn/network/spoke-networking:0.4.0

Overview

Workload Network Configuration Module

This module deploys a workload virtual network with associated resources, providing a standardized approach to configuring network infrastructure for workload environments. It simplifies the deployment process by automating the setup of key networking components and ensuring best practices for security and connectivity.

Features Implemented

  • Virtual Network: Deploys a virtual network with configurable address space and subnets.
  • Subnets: Creates subnets with customizable configurations for various workload components.
  • Network Security Groups (NSGs): Attaches NSGs to subnets with pre-defined or custom security rules.
  • Route Tables: Configures route tables for subnets to control network traffic flow.
  • Peering: Establishes virtual network peering with a hub network for centralized connectivity.
  • Azure Firewall Rules: Optionally creates firewall policy rule collection groups for network security.
  • Diagnostics: Configures diagnostic settings for network resources.
  • Network Watcher: Deploys Network Watcher resources for network monitoring and troubleshooting.
  • Flow Logs: Sets up NSG flow logs for traffic analysis and security insights.

Default Behavior

By default, the module creates a virtual network with the address space defaulted to ‘10.0.10.0/24’.

There will be no subnets, peering or route tables. Network Watcher and diagnostics are enabled for comprehensive monitoring.

Customization

The module supports extensive customization through parameters, including:

  • Virtual Network and subnet address spaces
  • NSG rules and route table entries
  • Peering configurations
  • Azure Firewall rule collections
  • Diagnostic and monitoring settings

This module ensures a consistent and secure approach to deploying workload networking infrastructure, reducing manual configuration efforts and enforcing organizational standards.

Quick Start

To use this module, provide the necessary parameters such as name, location, and virtual network configuration. The module will handle the deployment and configuration of all associated networking resources.

module workloadNetwork 'br/public:avm/ptn/network/spoke-networking:<version>' = {
  name: 'workloadNetworkDeployment'
  params: {
    name: 'myWorkload'
    location: 'eastus'
    vnetConfig: {
      addressPrefixes: ['10.0.0.0/16']
      subnets: [
        {
          name: 'subnet1'
          addressPrefix: '10.0.1.0/24'
        }
      ]
    }
  }
}

This deployment will create a basic workload network setup, which can be further customized as needed.

Parameters

NameTypeRequiredDefaultDescription
addressPrefixesarrayYesRequired. An Array of 1 or more IP Address Prefixes for the Virtual Network.
azureFirewallRulesCollectionGroupobjectNo{}Optional. Create an Azure Firewall Policy Rules Collection Group.
connectionMonitorsarrayNo[]Optional. Array that contains the Connection Monitors.
ddosProtectionPlanResourceIdstringNoOptional. Resource ID of the DDoS protection plan to assign the VNET to. If it’s left blank, DDoS protection will not be configured. If it’s provided, the VNET created by this template will be attached to the referenced DDoS protection plan. The DDoS protection plan can exist in the same or in a different subscription.
diagnosticsStoragemonitoringStorageType (object)No{}Optional. Resource ID(s) of storage systems that are used for diagnostics monitoring. Defaults to empty.
disableBgpRoutePropagationboolNofalseOptional. Switch to disable BGP route propagation.
dnsServersarrayNoOptional. DNS Servers associated to the Virtual Network.
enableTelemetryboolNotrueOptional. Enable/Disable usage telemetry for module.
enableVmProtectionboolNoOptional. Indicates if VM protection is enabled for all the subnets in the virtual network.
flowLogsarrayNo[]Optional. Array that contains the Flow Logs.
flowTimeoutInMinutesintNo0Optional. The flow timeout in minutes for the Virtual Network, which is used to enable connection tracking for intra-VM flows. Possible values are between 4 and 30 minutes. Default value 0 will set the property to null.
hubRoutesrouteConfigArrayType (array)No[]Optional. An array of routes to add to the hub Virtual Network. Each route has a name and an array of routes. The Name for this route must be the resource ID of the target route table.
locationstringNo"[deployment().location]"Optional. Location for all resources.
locklockType (object)NoOptional. The lock settings of the service.
namestringNo"[format('NetworkWatcher_{0}', parameters('location'))]"Optional. Name of the Network Watcher resource (hidden).
networkSecurityGroupsnsgConfigArrayType (array)No[]Optional. An array of Network Security Groups to add to the Virtual Network. Each NSG has a name and an array of rules. The Name for this NSG Group should match the subnet name to be automatically associated.
partnerCountrystringNo"norway"Optional. The Partner ID for partner attribution.
peeringsarrayNoOptional. Virtual Network Peering configurations.
roleAssignmentsroleAssignmentType (array)NoOptional. Array of role assignments to create.
routesrouteConfigArrayType (array)No[]Optional. An array of routes to add to the Virtual Network. Each route has a name and an array of routes. The Name for this route should match the subnet name to be automatically associated.
subnetsarrayNoOptional. An Array of subnets to deploy to the Virtual Network.
tagsobjectNoOptional. Tags of the resource.
vnetEncryptionboolNofalseOptional. Indicates if encryption is enabled on virtual network and if VM without encryption is allowed in encrypted VNet. Requires the EnableVNetEncryption feature to be registered for the subscription and a supported region to use this property.
vnetEncryptionEnforcementstringNo"AllowUnencrypted"Optional. If the encrypted VNet allows VM that does not support encryption. Can only be used when vnetEncryption is enabled.

Outputs

NameTypeDescription
networkResourceGroupResourceIdstringThe resource ID of the deployed virtual network.
networkWatcherLocationstringThe location the resource was deployed into.
networkWatcherResourceGroupIdstringThe resource group ID of the deployed network watcher.
networkWatcherResourceGroupNamestringThe resource group the network watcher was deployed into.
networkWatcherResourceIdstringThe resource ID of the deployed network watcher.
networkWatchernamestringThe name of the deployed network watcher.
nsgNamesarrayThe name of the route table.
nsgNamesListarrayThe names of all Routes provided.
nsgResourceIdsarrayThe resource ID of the route table.
routeNamesListarrayThe names of all Routes provided.
routeTableNamesarrayThe name of the route table.
routeTableResourceIdsarrayThe resource ID of the route table.
subnetNamesarrayThe names of the deployed subnets.
subnetResourceIdsarrayThe resource IDs of the deployed subnets.
virtualNetworkNamestringThe name of the virtual network.
virtualNetworkResourceIdsstringThe resource IDs of the deployed virtual network.

Changelog

No changelog has been published for this module yet. See the version history below.

Version history

VersionPublished
0.4.02025-02-26