@@ -42,9 +42,26 @@ param dnsZoneNames = [
4242]
4343
4444
45- // Network configuration: only used when existingVnetResourceId is not provided
46- // These addresses are only used when creating a new VNet and subnets
47- // If you provide existingVnetResourceId, these values will be ignored
45+ // Network configuration (behavior depends on `existingVnetResourceId`)
46+ //
47+ // - NEW VNet (existingVnetResourceId is empty):
48+ // The values below are used to CREATE the VNet and the two subnets.
49+ // Provide explicit, non-overlapping CIDR ranges when creating a new VNet.
50+ //
51+ // - EXISTING VNet (existingVnetResourceId is provided):
52+ // The module will reference the existing VNet. Subnet handling depends on the
53+ // values you provide:
54+ // * If `agentSubnetPrefix` or `peSubnetPrefix` are empty, the module may
55+ // auto-derive subnet CIDRs from the existing VNet's address space
56+ // (using cidrSubnet). This can produce /24 (or configured) subnets
57+ // starting at index 0, 1, etc.
58+ // * If you provide explicit subnet prefixes, the module will attempt to
59+ // create or update subnets with those prefixes in the existing VNet.
60+ //
61+ // Important operational notes and risks (when existingVnetResourceId is provided):
62+ // - Avoid CIDR overlaps with any existing subnets in the target VNet. Overlap
63+ // leads to `NetcfgSubnetRangesOverlap` and failed deployments.
64+ // - For highest safety when using an existing VNet, supply the existing `agentSubnetPrefix` and `peSubnetPrefix`.
4865param vnetAddressPrefix = ''
4966param agentSubnetPrefix = ''
5067param peSubnetPrefix = ''
0 commit comments