Add ability to calculate number of subnets to CIDR functions
- Dominant language
- Bicep
- Stars
- 3.6k
- Forks
- 830
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 79
Description
In addition to the currently [available CIDR functions](https://learn.microsoft.com/azure/azure-resource-manager/bicep/bicep-functions-cidr), I would also like to be able to calculate how many subnets could be carved out. This function would return a single integer.
**Describe the solution you'd like**
Example:
```bicep
var maxSubnets = cidrSubnetCount(network, newCIDR)
```
For `network = 10.0.0.0/16` and `newCIDR = 24`, this would return `256`.
Contributor guide
Research direction
Read the linked CIDR functions documentation first to understand the existing function behavior and naming. Use the issue's 10.0.0.0/16 and /24 example as the initial expected result, then verify that the new function returns the correct subnet count for equivalent CIDR inputs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure
- Domain
- cloud, networking
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100