infoblox_ip_association
The infoblox_ip_association
resource enables you to manage DHCP related properties of the host record object that was created using the infoblox_ip_allocation resource. You can update the host record created using the allocation resource with details of the VM created in the cloud environment. The VM details include a MAC address in case of an IPv4 address and a DUID in case of an IPv6 address.
The following table describes the parameters you can define in the infoblox_ip_association
resource block:
Parameter | Required/Optional | Description | Example Value |
---|---|---|---|
| Required | Specifies the value of the Terraform Internal ID extensible attribute listed as a a prerequisite for the plug-in, it is generated for the host record when creating the
|
|
| Optional | Specifies whether the host record must be created in the DHCP server side. |
|
| Required only if the host record has an IPv4 address | Applies only to IPv4 addresses. Note: When you keep the default value, the |
|
| Required only if the host record has an IPv6 address | Applies only for IPv6 addresses. Note: If the host record contains of an IPv6 address, you must enter a value in this field. Otherwise, NIOS returns an error when the association resource is created. | 34:df:37:1a:d9:7f (The DUID could be the same type of value as the MAC address of a network interface). |
Note
Currently, for a host record with both IPv4 and IPv6 addresses, you can disable or enable DHCP for both the address types at the same time using the Terraform plug-in.
If you want to disable DHCP for any one of the addresses when the flag is enabled (enable_dhcp = "true"), in the
infoblox_ip_association
resource block, comment outmac_addr
to disable only the IPv4 address, or comment outduid
to disable only the IPv6 address.If you want to enable DHCP for any one of the addresses when the flag is disabled (enable_dhcp = "false"), in the
infoblox_ip_association
resource block, setenable_dhcp = "true"
, then comment outmac_addr
to keep only the IPv6 address, or comment out theduid
to keep only the IPv4 address.
This causes the MAC address or DUID to be disassociated from the host record at the NIOS side.
Example of the Resource Block
The following examples of infoblox_ip_association
, reference the examples of infoblox_ip_allociation
in the infoblox_ip_allocation topic. You can link the examples by referring to the allocation resource name used in the internal_id
parameter.
resource "infoblox_ip_association" "association1" {
internal_id = infoblox_ip_allocation.allocation1.id // which of the
// existing host records to deal with
# enable_dhcp = false // this is the default
mac_addr = "12:00:43:fe:9a:8c" // the address will be assigned but
// the DHCP configuration will not contain it
}
resource "infoblox_ip_association" "association2" {
internal_id = infoblox_ip_allocation.allocation4.id // choose an
//allocation resource for which enable_dns = false
# enable_dhcp = false // this is the default
duid = "00:43:d2:0a:11:e6" // the address will be assigned but
//the DHCP configuration will not contain it
}
resource "infoblox_ip_association" "association3" {
internal_id = infoblox_ip_allocation.allocation5.id
enable_dhcp = true // all systems go
mac_addr = "12:43:fd:ba:9c:c9"
duid = "00:43:d2:0a:11:e6"
}
resource "infoblox_ip_association" "association4" {
internal_id = infoblox_ip_allocation.allocation3.id
enable_dhcp = true // all systems go
// DHCP will be enabled for IPv4 ...
mac_addr = "09:01:03:d3:db:2a"
// ... and disabled for IPv6
# duid = "10:2a:9f:dd:3e:0a"
// yes, the DUID will be dissociated. but, you can
// uncomment it if you decide to enable DHCP for IPv6
}