WHAT’S NEW IN INFOBLOX TERRAFORM PROVIDER V2.7

Introduction

In the realm of network automation and infrastructure management, Infoblox stands as a pioneer, consistently delivering cutting-edge solutions to simplify and streamline complex network assignments. The latest update, version v2.7 of the Infoblox IPAM Driver for Terraform, promises enhanced efficiency, flexibility, and control over network resources. This update introduces exciting new features and improvements that cater to the evolving needs of network administrators and infrastructure managers.

Terraform is a widely used popular infrastructure-as-code software tool created by HashiCorp. Users define and provide data center infrastructure using a declarative configuration language known as HashiCorp Configuration Language, or optionally JSON. which lets you build, change, and version cloud and on-premise resources safely and efficiently. We always fix bugs with our latest updates and try to make the user experience more enhanced, but this time there are some additions to it as well.

Terraform-Infoblox Integration

A provider plugin for Terraform, that makes it possible to manage Infoblox NIOS (Network Identity Operating System) resources using Terraform infrastructure-as-code solutions, is now available. The plugin enables lifecycle management of Infoblox NIOS DDI resources. The Infoblox IPAM Plug-In for Terraform interfaces with Infoblox vNIOS through REST API to provide IP address management and DNS services. Instead of manually provisioning IP addresses and DNS records for network devices and interfaces in your infrastructure, the Infoblox IPAM Plug-In for Terraform automates IPAM processes. The latest version of the Infoblox provider is v2.7.

Available Resources

Currently, Terraform resources can be broadly divided into two categories: Terraform Resources and Data Sources. A Terraform Resource constitutes a resource block that describes one or more NIOS Grid objects, such as a network container. A Terraform Data Source allows data to be fetched or computed for use elsewhere in the Terraform configuration. With Data Sources, Terraform configuration is built on information defined outside of Terraform or defined by a separate Terraform configuration.

To perform a fetch, create, read, update, or delete operation on a NIOS object, you must define the appropriate resource block in the Terraform configuration (.tf) file. The following topics detail the resources and data sources supported by Infoblox IPAM Plug-In version v2.7 for Terraform and include appropriate examples of blocks that must be defined in the configuration file. For more details on Terraform’s available resources and Data Sources, visit Infoblox Plug-In for Terraform. Read more on Terraform’s official registry for Infoblox.

Recent Developments, Additions and Updates

 
Upgrade Terraform version from 0.14 to 1.8.1

To use the new features and functionality from version 2.7, you will need to upgrade your Terraform version.

  • Performance Improvements: Updates will optimize code and introduce more efficient algorithms, leading to better performance of the integrated systems.
  • Compatibility: Newer versions will ensure compatibility with new/latest features that we have added to the plugin.

Update Go-Lang from 1.17 to 1.21 or later & Go-client version to v2.7.0

We still maintain our stance similar to earlier releases and are very clear that only if you plan to develop a plugin that includes features that are not in the published version, then only do you need to install the Infoblox-Go-Client and Go programming language.

  • Performance Improvements: Updates will optimize code and introduce more efficient algorithms, leading to better performance of the integrated systems.
  • Compatibility: Newer versions will ensure compatibility with new/latest features that we have added to the plugin.

Support for Import Block Functionality

Figure 1

Why Import?

Terraform Import makes it easier to bring pre-existing cloud resources under Terraform administration. In order to apply updates to the same set of infrastructure via Infrastructure as a Code (IaC) in the future, the Terraform CLI command import is used to read real-world infrastructure and update the state.

Configuration Consistency: Terraform Import ensures that all your resources, regardless of origin, are managed and tracked consistently. This tracking approach helps avoid manual configuration drift and maintains a single source of truth for your infrastructure.

Incremental Adoption: Terraform Import allows you to adopt Terraform for existing resources incrementally. You don’t need to start from scratch, and you can gradually manage your infrastructure with Terraform without disruption.

Collaboration and Version Control: By importing resources, you can collaborate with your team using a shared version-controlled Terraform state. In this way you’ll enhance team collaboration and ensure everyone works with the same infrastructure definitions.

Since Terraform plug-in v2.2.0, only able to import single resources using their respective reference IDs with a CLI command. Read more for importing a single resource. However, with plug-in version 2.7, we have enhanced the plug-in to import multiple resources with a single command called an “import block”. For example; you can import all the records (A, AAAA, MX, PTR records etc.) present in one or multiple zones, all the networks present in a network container into your Terraform state file via a single Terraform configuration file. The import block is faster and more efficient than the import command, because it can automate import of multiple resources, which will not save you significant time and effort, but also give you more options for classifying or organizing your data in groups by importing and keeping them in organised Terraform state files.

Additionally- please note that the Terraform internal ID that is assigned to the resource when the Terraform plan command is run for the first time, is retained even if a subsequent Terraform apply is aborted, though the resource is not managed by Terraform.

Import by Using the Import Block

Define the import block in the Terraform configuration (.tf) file of a resource that must be imported. In the .tf file of the resource to import, include the following block:


        import { 
        to = <resource_type>.<resource_name> 
        id = "reference_id" 
        } 
        

The parameters you can define in the import block are:

Parameter Required/Optional Description
to Required Specifies the instance address of this resource in the Terraform state file.
id Required Specifies the Terraform Internal ID assigned to the resource by NIOS. It is referred to as the reference ID in the import block and as Terraform Internal ID for host records.

Example:


        #terraform block
        terraform { 
          required_providers { 
            infoblox = { 
              source = "infobloxopen/infoblox" 
              version = "2.7.0" 
             } 
          } 
        }
        
        #provider block
        provider "infoblox" { 
          server = "<your_grid_IP" 
          username = "admin" 
          password = "*****"
        }
        
        #import all A-records from the zone /example1.org
        data "infoblox_a_record" "data-a-rec" { 
          filters = { 
            zone = "example1.org" 
            view = "default" 
           } 
        }
        
        import { 
          for_each = data.infoblox_a_record.data-a-rec.results 
          id       = each.value.id 
          to       = infoblox_a_record.imported_records["${each.value.fqdn}"] 
        }

        resource "infoblox_a_record" "imported_records" { 
          for_each = { for record in data.infoblox_a_record.data-a-rec.results : record.fqdn => record } 
          fqdn      = each.value.fqdn 
          ip_addr   = each.value.ip_addr 
          dns_view  = each.value.dns_view 
          ttl       = each.value.ttl 
          comment   = each.value.comment 
          ext_attrs = each.value.ext_attrs 
        }
        

Resource and Data Source for DNS Conditional Forwarder Zones

This is an addition of a new resource and data source to our present capacities of the plug-in. The infoblox_zone_forward resource enables you to perform create, update, and delete operations on forward zones in a Infoblox NIOS appliance. The infoblox_zone_forward resource corresponds to the ‘zone_forward’ WAPI object in NIOS. A forwarder is a name server to which all other name servers first send queries that they cannot resolve locally. The forwarder then sends these queries to DNS servers that are external to the network, avoiding the need for the other name servers in your network to send queries off-site. A forwarder eventually builds up a cache of information, which it uses to resolve queries. This reduces Internet traffic over the network and decreases the response time to DNS clients. This is useful in organizations that need to minimize off-site traffic, such as a remote office with a slow connection to a company’s network. You can select any Grid member to function as a forwarder. You must configure your firewall to allow that Grid member to communicate with external DNS servers. You can also configure NIOS to send queries to one or more forwarders. In addition, you can define a list of forwarders for the entire Grid, for each Grid member, or for each DNS view.

If your network configuration includes Infoblox BloxOne Threat Defense, you can configure NIOS Grid members (physical or virtual appliance) to forward recursive queries to BloxOne Threat Defense. 

When there is more than one forwarder in the Grid, the NIOS resolver uses a smoothed metric derived from RTT (Round Trip Time) to select the name server to send queries to. RTT is the length of time between when a query was sent and when its response was received.

Example Scripts for Forward Zone Resources


        #Copy Terraform and Provider Block from above example script 
        #forward zone with ns_group and external_ns_group
        resource "infoblox_zone_forward" "forward_zone3" { 
          fqdn = "params_ns_ens.ex.org" 
          ns_group = "test" 
          external_ns_group = "stub server" 
        }
       

        #Copy Terraform and Provider Block from above example script. 
        #forward mapping zone, with minimum set of parameters
        resource "infoblox_zone_forward" "forward_zone1" { 
          fqdn = "min_params.ex.org" 
          forward_to { 
             name = "test22.dz.ex.com" 
             address = "10.0.0.1" 
            } 
         forward_to { 
            name = "test2.dz.ex.com" 
            address = "10.0.0.2" 
           } 
        }
        
        
        #Copy Terraform and Provider Block from above example script. 
        #forward zone with full set of parameters
        resource "infoblox_zone_forward" "forward_zone2" { 
          fqdn = "max_params.ex.org" #required 
          view = "nondefault_view" #optional 
          zone_format = "FORWARD" #optional 
          comment = "test sample forward zone" #optional 
          forward_to { 
            name = "te32.dz.ex.com" 
            address = "10.0.0.1" 
           } 
        forwarding_servers { 
          name = "infoblox.172_28_83_216" 
          forwarders_only = true 
          use_override_forwarders = false 
          forward_to { 
            name = "cc.fwd.com" 
            address = "10.1.1.1" 
           } 
        } 
       forwarding_servers { 
         name = "infoblox.172_28_83_0" 
         forwarders_only = true 
         use_override_forwarders = true 
         forward_to { 
            name = "kk.fwd.com" 
            address = "10.2.1.31" 
           } 
         } 
       }
        

Data Sources for Host Record, IPv6 Network Container, and IPv6 Network

This feature is an addition of data sources to already present resources in our repository. These four new data sources have been introduced with this release and is an extension of our earlier effort of bringing more resources into the umbrella of multi-value extensible attributes search for data sources for easy and efficient searching of objects/resources to increase its manageability. To see the proper structure to fetch data sources you can refer to Ability to search through Extensible Attributes in data sources.

Conclusion

The latest update to the Infoblox IPAM Driver for Terraform represents a significant milestone in network automation and infrastructure management. With new features, such as IPv6 Network Resource, enhanced resource management, and seamless integration with the Infoblox Cloud Platform, users can unlock new levels of efficiency, flexibility, and control over their network environments.

As organizations continue to embrace digital transformation and the adoption of cloud-native technologies, the Infoblox IPAM Driver for Terraform stands ready to meet the evolving needs of modern IT infrastructure. Whether you are managing a small-scale network or a large enterprise deployment, Infoblox remains committed to empowering users with innovative solutions that simplify complexity and drive business success.

Stay tuned for future updates and enhancements as we continue to innovate and deliver value to our customers. Stay tuned for future updates and enhancements as we continue to innovate and deliver value to our customers.