Azure / terraform-azurerm-avm-res-azurestackhci-logicalnetwork

MIT License
1 stars 3 forks source link

Add support for Dynamic IP Allocation #11

Closed kumdeepakgit closed 1 month ago

kumdeepakgit commented 1 month ago

Description

Problem

Currently, only logical networks of type "Static" can be created. The "Static" type is hardcoded as shown below:

  subnet_0_properties_full = {
    addressPrefix      = var.address_prefix, # compute from starting address and ending address
    ipAllocationMethod = "Static",
    ipPools = [{
      info  = {}
      start = var.starting_address
      end   = var.ending_address
    }]

Solution

This PR introduces a way to specify the type of logical network through the following variable:

  1. ip_allocation_method [Optional] - Specifies whether the IP address allocation should be "Static" or "Dynamic". This variable is optional and defaults to Dynamic.

How to test

Navigate to examples/dhcp/ and execute the terraform commands.

Type of Change

Checklist