---
title: "infoblox_ip_association"
canonical: "https://docs.infoblox.com/space/ipamdriverterraform/53023339/infoblox_ip_association"
format: markdown
---
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](https://infoblox-docs.atlassian.net/wiki/spaces/ipamdriverterraform/pages/53121460)* resource.<span style="color: #000000"> 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.</span>

<span style="color: #000000">The following table describes the parameters you can define in the </span>`infoblox_ip_association`<span style="color: #000000"> resource block:</span>

| <span style="color: #000000">**Parameter**</span> | <span style="color: #000000">**Required/Optional**</span> | <span style="color: #000000">**Description**</span> | <span style="color: #000000">**Example Value**</span> |
| --- | --- | --- | --- |
| `internal_id` | Required | Specifies the value of the Terraform Internal ID extensible attribute listed as a a *[prerequisite](https://infoblox-docs.atlassian.net/wiki/pages/createpage.action?spaceKey=ipamdriverterraform&title=Installing%20Infoblox%20IPAM%20Plug-In%20Version%20for%20Terraform&linkCreation=true&fromPageId=53023339)* for the plug-in, it is generated for the host record when creating the `infoblox_ip_allocation` resource and is located in the `id` field of the appropriate `infoblox_ip_allocation` resource.  
**Note**:<br>- The reference to the `internal_id` field of `infoblox_ip_allocation` will continue to work until the next release.
- The `id` and `internal_id` fields of the `infoblox_ip_allocation` resource use the same values. | `infoblox_ip_allocation.foo.id` |
| `enable_dhcp` | <span style="color: #000000">Optional</span> | <span style="color: #000000">Specifies whether the host record must be created in the DHCP server side.</span>  
<span style="color: #000000">The default value is </span>`false`<span style="color: #000000">.</span> | `true` |
| `mac_addr` | Required only if the host record has an IPv4 address | <span style="color: #000000">Applies only to IPv4 addresses.</span>  
<span style="color: #000000">It specifies the MAC address to associate the IP address wit</span>h. It is the MAC address of the network interface of the cloud instance that corresponds to the host record created using the `infoblox_ip_allocation` resource.  
<span style="color: #000000">The default value is an empty string, which is internally transformed to 00:00:00:00:00:</span>`00`.<br>**Note**: When you keep the default value, the `enable_dhcp` flag in NIOS for the referenced IPv4 address, is automatically set to `false` even though the field is set to `true` in the terraform.tfstate file. | `02:42:97:87:70:f9` |
| `duid` | Required only if the host record has an IPv6 address | Applies only for IPv6 addresses.   
It specifies the DHCPv6 Unique Identifier (DUID) of the address object.  
The default is an empty string.<br>**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**
> ⚠️ 
> ⚠️ <span style="color: #000000">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.</span>
> ⚠️ 
> ⚠️ - <span style="color: #000000">If you want to disable DHCP for any one of the addresses when the flag is enabled (enable_dhcp = "true"), in the </span>`infoblox_ip_association` resource block, <span style="color: #000000">comment out</span> `mac_addr` to disable only the IPv4 address, or comment out `duid` 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, set `enable_dhcp = "true"`, then comment out `mac_addr` to keep only the IPv6 address, or comment out the `duid` to keep only the IPv4 address.
> ⚠️ 
> ⚠️ This causes the MAC address or DUID to be disassociated from the host record at the NIOS side.

## <span style="color: #000000">Example of the Resource Block</span>

The following examples of `infoblox_ip_association`, reference the examples of<span style="color: #ff5630"> </span>`infoblox_ip_allociation` in the *[infoblox_ip_allocation](https://infoblox-docs.atlassian.net/wiki/spaces/ipamdriverterraform/pages/53121460)* 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`  
`}`