With the IP address association operation, you can update the Host record created using the IP address allocation operation with details of the VM created in the cloud environment. The VM details include DUID and VM tags as extensible attributes.
Note
If you are not using other Terraform providers with the Infoblox provider to deploy virtual machines and allocate IP addresses from NIOS, then ignore the infoblox_ipv6_association
resource block, which is used for updating the properties of virtual machines.
The resource maps the IP address of a Host record created in NIOS to a VM, by MAC address. The following table describes the parameters you can define in the resource block: Parameter Required/Optional Description Example Value Required Specifies the name (in FQDN format) of a host with which an IP address needs to be associated. When When Optional Specifies the network view from which to get the specified network block. If a value is not specified, the default network view is considered. Optional Specifies the DNS view in which to create the DNS resource records that are associated with the IP address. If a value is not specified, the default DNS view is considered. This parameter is relevant only if Optional A flag that specifies whether DNS records associated with the resource must be created. The default value is Optional A flag that specifies whether to enable DHCP-related functionality for this resource. The default value is Required Specifies an IP address that must be associated (marked as ‘Used’ in NIOS Grid Manager). Optional Specifies the time to live value for the DNS record. This parameter is relevant only when Optional Describes the resource. Optional Set of NIOS extensible attributes that are attached to the resource.fqdn
enable_dns
is set to true
, specify the zone name along with the host name in format:
<hostname>.<zone>.com
Example: hostname1.zone.com
enable_dns
is set to false
, specify only the host name:
<hostname>
Example: hostname1
ip-12-34-56-78.us-west-2.compute.internal
network_view
networkview_name
dns_view
enable_dns
is set to true
.dns_view_name
enable_dns
true
.true
enable_dhcp
false
.false
ip_addr
10.4.3.138
ttl
enable_dns
is to true
.
If a value is not specified, the value is same as that of the parent zone of the DNS records for this resource.3600
comment
Associating an IPv4 address.
ext_attrs
jsonencode({})
Additionally, define the following parameter for infoblox_ipv6_association
:
Parameter | Required/Optional | Description | Example Value |
---|---|---|---|
| Required | It specifies the DHCPv6 Unique Identifier (DUID) of the address object. |
|
Example of the Resource Block
As the IP address association operation is dependent on the allocation operation, the following examples for IPv6 addresses demonstrate how to define the resource blocks in the Terraform configuration file:
resource "infoblox_ipv6_allocation" "ipv6_allocation" {
network_view= "default"
cidr = infoblox_ipv6_network.ipv6_network.cidr
#Create Host Record with DNS and DHCP flags
dns_view="default"
fqdn="testipv6.aws.com"
enable_dns = "true"
comment = "tf IPv6 allocation"
ext_attrs = jsonencode({
"Tenant ID" = "tf-plugin"
"Cloud API Owned" = "True"
"CMP Type"= "AWS"
"Network Name" = "ipv6-tf-network"
"VM Name" = "tf-ec2-instance-ipv6"
"Location" = "Test loc."
"Site" = "Test site"
})
}
resource "infoblox_ipv6_association" "ipv6_associate"{
network_view = infoblox_ipv6_allocation.ipv6_allocation.network_view
ip_addr = infoblox_ipv6_allocation.ipv6_allocation.ip_addr
duid = aws_network_interface.ni.mac_address
#Create Host Record with DNS and DHCP flags
dns_view=infoblox_ipv6_allocation.ipv6_allocation.dns_view
fqdn=infoblox_ipv6_allocation.ipv6_allocation.fqdn
enable_dns = infoblox_ipv6_allocation.ipv6_allocation.enable_dns
enable_dhcp = infoblox_ipv6_allocation.ipv6_allocation.enable_dhcp
comment = ""Associating of an IPv6 address""
ext_attrs = jsonencode({
"Tenant ID" = "tf-plugin"
"Cloud API Owned" = "True"
"CMP Type"= "AWS"
"Network Name" = "ipv6-tf-network"
"VM Name" = "tf-ec2-instance-ipv6"
"VM ID" = aws_instance.ec2-instance.id
"Location" = "Test loc."
"Site" = "Test site"
})
}