Skip to content

Commit

Permalink
updating docs folder and ReadME for zone-delegated and next-available (
Browse files Browse the repository at this point in the history
…#412)

* updating docs folder and ReadME for zone-delegated and next-available

* updating review comments for documentation

* removing default values for data source example
  • Loading branch information
Aish-sp authored Oct 29, 2024
1 parent 22dffc3 commit 1a5836e
Show file tree
Hide file tree
Showing 12 changed files with 287 additions and 26 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ The provider plug-in has NIOS DDI resources represented as Terraform resources a
* Allocation and deallocation of an IP address from a Network (`infoblox_ip_allocation`)
* Association and disassociation of an IP address from a VM (`infoblox_ip_association`)
* Zone Forward (`infoblox_zone_forward`)
* Zone Delegated (`infoblox_zone_delegated`)

All of the above resources are supported with `comment` and `ext_attrs` fields.
DNS records and the `infoblox_ip_allocation` resources are supported with `ttl` field.
Expand All @@ -55,6 +56,7 @@ DNS records and the `infoblox_ip_allocation` resources are supported with `ttl`
* IPv6 Network (`infoblox_ipv6_network`)
* IPv6 Network Container (`infoblox_ipv6_network_container`)
* Host-record (`infoblox_host_record`)
* Zone Delegated (`infoblox_zone_delegated`)

All of the above data sources are supported with `comment` and `ext_attr` fields.
Data source of DNS records are supported with `ttl` and `zone` fields.
Expand Down
2 changes: 2 additions & 0 deletions docs/data-sources/infoblox_host_record.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ Use the `infoblox_host_record` data source to retrieve the following information
* `enable_dhcp`: the flag to enable or disable the DHCP record. Example: `true`.
* `comment`: the description of the record. This is a regular comment. Example: `Temporary A-record`.
* `ext_attrs`: the set of extensible attributes of the record, if any. The content is formatted as string of JSON map. Example: `"{\"TestEA\":56,\"TestEA1\":\"kickoff\"}"`
* `disable`: the flag that specifies whether the record is disabled. Example: `false`.
* `aliases`: the list of aliases associated with the Host-record. Example: `["alias1.test.com", "alias2.test.com"]`.

To retrieve information about host records that match the specified filters, use the `filters` argument and specify the parameters mentioned in the below table. These are the searchable parameters of the corresponding object in Infoblox NIOS WAPI. If you do not specify any parameter, the data source retrieves information about all host records in the NIOS Grid.

Expand Down
111 changes: 111 additions & 0 deletions docs/data-sources/infoblox_zone_delegated.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
# Zone Delegated Data Source

Use the `infoblox_zone_delegated` data source to retrieve the following information about a delegated DNS zone from the corresponding object in NIOS:

* `fqdn`: The name of this DNS zone. For a reverse zone, this is in “address/cidr” format. Example: `11.10.0.0/24`. For other zones, this is in FQDN format. Example: `demozone.com` This value can be in unicode format.
* `view`: The name of the DNS view in which the zone resides. Example: `external`.
* `comment`: The Description of Delegated Zone Object. Example: `random delegated zone`.
* `ext_attrs`: The set of extensible attributes of the record, if any. The content is formatted as string of JSON map. Example: `"{\"Location\":\"unknown\",\"TestEA\":\"ZoneTesting\"}"`.
* `zone_format`: Determines the format of corresponding zone. Valid values are `FORWARD`, `IPV4` and `IPV6`.
* `ns_group`: Specifies the name server group that serves DNS for this zone. Example: `demoGroup`.
* `disable`: Specifies whether the zone is disabled.
* `locked`: The flag that restricts other administrators from making any changes. Note that this flag is for administration purposes only. The zone will continue to serve DNS data even when it is locked. Example: `false`.
* `delegated_ttl`: The TTL value for the delegated zone. Example: `60`.
* `delegate_to`: The remote server to which the NIOS appliance redirects queries for data for the delegated zone. Example:
```terraform
delegate_to {
name = "te32.dz.ex.com"
address = "10.0.0.1"
}
```

For usage of filters, add the fields as keys and appropriate values to be passed to the keys like `fqdn`, `view` corresponding to object.
From the below list of supported arguments for filters, use only the searchable fields for retrieving the matching records.

### Supported Arguments for filters

-----
| Field | Alias | Type | Searchable |
|-------------|-------------|--------|------------|
| fqdn | fqdn | string | yes |
| view | view | string | yes |
| zone_format | zone_format | string | yes |
| comment | comment | string | yes |


!> Any combination of searchable fields in the supported arguments list for fields is allowed.

!> "Aliases are the parameter names used in the prior releases of Infoblox IPAM Plug-In for Terraform. Do not use the alias names for parameters in the data source blocks. Using them can result in error scenarios."

### Example for using the filters:
```hcl
data "infoblox_zone_delegated" "data_zone_delegated" {
filters = {
fqdn = "zone_delegated.ex.org"
view = "default"
}
}
```
!> From the above example, if the 'view' value is not specified, if same zone name exists in one or more different DNS views, those
all zones will be fetched in results.

!> If `null` or empty filters are passed, then all the zones or objects associated with datasource like here `infoblox_zone_delegated` will be fetched in results.

### Example of the Zone Delegated Data Source Block

```hcl
resource "infoblox_zone_delegated" "delegatedzone_delegateTo" {
fqdn = "zone_delegated.ex.org"
delegate_to {
name = "test22.dz.ex.com"
address = "10.0.0.1"
}
delegate_to {
name = "test2.dz.ex.com"
address = "10.0.0.2"
}
ext_attrs = jsonencode({
"Site" = "Antarctica"
})
}
// accessing Zone Delegated by specifying fqdn, view and extra attribute Site
data "infoblox_zone_delegated" "data_zone_delegated" {
filters = {
fqdn = "zone_delegated.ex.org"
view = "default"
"*Site" = "Antarctica"
}
// This is just to ensure that the record has been be created
depends_on = [infoblox_zone_delegated.delegatedzone_delegateTo]
}
// returns matching Zone Delegated with fqdn and view, if any
output "zone_delegated_data3" {
value = data.infoblox_zone_delegated.data_zone_delegated
}
resource "infoblox_zone_delegated" "delegatedzone_IPV4_nsGroup" {
fqdn = "195.1.0.0/24"
comment = "Delegated zone IPV4"
zone_format = "IPV4"
ns_group = "test"
}
// accessing Zone Delegated by specifying fqdn, view and comment
data "infoblox_zone_delegated" "datazone_delegated_fqdn_view_comment" {
filters = {
fqdn = "195.1.0.0/24"
view = "default"
comment = "Delegated zone IPV4"
}
// This is just to ensure that the record has been be created
depends_on = [infoblox_zone_delegated.delegatedzone_IPV4_nsGroup]
}
// returns matching Zone Delegated with fqdn, view and comment, if any
output "zone_delegated_data4" {
value = data.infoblox_zone_delegated.datazone_delegated_fqdn_view_comment
}
```
3 changes: 1 addition & 2 deletions docs/data-sources/infoblox_zone_forward.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ Use the `infoblox_zone_forward` data source to retrieve the following informatio

* `fqdn`: The name of this DNS zone. For a reverse zone, this is in “address/cidr” format. Example: `11.10.0.0/24`. For other zones, this is in FQDN format. Example: `demozone.com` This value can be in unicode format.
* `view`: The name of the DNS view in which the zone resides. Example: `external`.
* `zone_format`: Determines the format of corresponding zone. Valid values are `FORWARD`, `IPV4` and `IPV6`.
* `comment`: The Description of Forward Zone Object. Example: `random forward zone`.
* `ext_attrs`: The set of extensible attributes of the record, if any. The content is formatted as string of JSON map. Example: `"{\"Location\":\"unknown\",\"TestEA\":\"ZoneTesting\"}"`.
* `zone_format`: Determines the format of corresponding zone. Valid values are `FORWARD`, `IPV4` and `IPV6`. Default value: `FORWARD`.
* `zone_format`: Determines the format of corresponding zone. Valid values are `FORWARD`, `IPV4` and `IPV6`.
* `ns_group`: Specifies the name server group that serves DNS for this zone. Example: `demoGrp`.
* `external_ns_group`: Specifies the name of the forward stub server. Example: `stubGroup`.
* `disable`: Specifies whether the zone is disabled. Default value: `false`.
Expand Down
15 changes: 14 additions & 1 deletion docs/resources/infoblox_a_record.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ The following list describes the parameters you can define in the resource block
* For allocating a static IP address, specify a valid IP address.
* For allocating a dynamic IP address, configure the `cidr` field instead of `ip_addr` . Optionally, specify a `network_view` if you do not want to allocate it in the network view `default`.
* `cidr`: required only for dynamic allocation, specifies the network from which to allocate an IP address when the `ip_addr` field is empty. The address is in CIDR format. For static allocation, use `ip_addr` instead of `cidr`. Example: `192.168.10.4/30`.
* `filter_params`: required only if `ip_addr` and `cidr` are not set, specifies the extensible attributes of the parent network that must be used as filters to retrieve the next available IP address for creating the record object. Example: `jsonencode({"*Site": "Turkey"})`.

!> To use upper case letters in `fqdn`, infoblox recommends that you use lower() function. Example: `lower("testEXAMPLE.zone1.com")`

Expand Down Expand Up @@ -48,4 +49,16 @@ resource "infoblox_a_record" "a_rec3" {
ttl = 0 // 0 = disable caching
ext_attrs = jsonencode({})
}
```
// dynamic A-record with filter_params
resource "infoblox_a_record" "rec"{
fqdn = "very-interesting-host.example.com"
ext_attrs = jsonencode({
"Location" = "65.8665701230204, -37.00791763398113"
})
filter_params = jsonencode({
"*Site": "Turkey"
})
comment = "A record"
}
```
14 changes: 14 additions & 0 deletions docs/resources/infoblox_aaaa_record.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ The following list describes the parameters you can define in the resource block
* For allocating a static IP address, specify a valid IP address.
* For allocating a dynamic IP address, configure the `cidr` field instead of `ipv6_addr` . Optionally, specify a `network_view` if you do not want to allocate it in the network view `default`.
* `cidr`: required only for dynamic allocation, specifies the network from which to allocate an IP address when the `ipv6_addr` field is empty. The address is in CIDR format. For static allocation, use `ipv6_addr` instead of `cidr`. Example: `2001::/64`.
* `filter_params`: Required only if `ipv6_addr` and `cidr` are not set, specifies the extensible attributes of the parent network that must be used as filters to retrieve the next available IP address for creating the record object. Example: `jsonencode({"*Site": "Turkey"})`.

!> To use upper case letters in `fqdn`, infoblox recommends that you use lower() function. Example: `lower("testEXAMPLE.zone1.com")`

Expand Down Expand Up @@ -48,4 +49,17 @@ resource "infoblox_aaaa_record" "aaaa_rec3" {
ttl = 0 // 0 = disable caching
ext_attrs = jsonencode({})
}
// dynamic AAAA-record with filter_params
resource "infoblox_aaaa_record" "aaaa_rec3" {
fqdn = "dyn1.test.com"
comment = "example dynamic AAAA-record aaaa_rec3, updated"
ttl = 60
ext_attrs = jsonencode({
"Location" = "65.8665701230204, -37.00791763398113"
})
filter_params = jsonencode({
"*Site": "Turkey"
})
}
```
19 changes: 19 additions & 0 deletions docs/resources/infoblox_ip_allocation.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,14 @@ The following list describes the parameters you can define in the `infoblox_ip_a
Use this parameter only when `ipv6_cidr` is not specified. The allocated IP address will be marked as ‘Used’ in NIOS Grid Manager.
The default value is an empty string. If you specify both `ipv6_addr` and `ipv6_cidr`, then the `ipv6_addr` address is allocated and `ipv6_cidr` is ignored.
Example: `2000:1148::10`.
* `filter_params`: required for dynamic allocation only if `ipv4_addr`, `ipv4_cidr`, `ipv6_addr` and `ipv6_cidr` are not set, specifies the extensible attributes of the parent network that must be used as filters to retrieve the next available IP address for creating the host record object.
The content is formatted as a string of a JSON map. Example: `jsonencode({"*Site": "Turkey"})`.
* `ip_address_type`: required only when filter_params is used, Specifies the type of IP address to allocate. The valid values are, `IPV4`, `IPV6`, and `Both`. The default value is `IPv4`.
* `ttl`: optional, specifies the 'time to live' value for the DNS record. This parameter is relevant only when `enable_dns` is set to `true`.
If a value is not specified, then in NIOS, the value is inherited from the parent zone of the DNS records for this resource. Example: `3600`.
* `disable`: optional,specifies whether the record disabled or not. The default value is `false`. Example: `true`.
* `comment`: optional, specifies the human-readable description of the resource. Example: `Front-end cloud node`.
* `aliases`: optional, specifies the list of aliases for the host record. Example: `["alias1", "alias2"]`.
* `ext_attrs`: optional, specifies the set of NIOS extensible attributes that are attached to the NIOS resource.
An extensible attribute must be a JSON map translated into a string value. Example:
```
Expand Down Expand Up @@ -168,4 +173,18 @@ resource "infoblox_ip_allocation" "allocation5" {
ipv6_cidr = infoblox_ipv6_network.net2.cidr
ipv4_cidr = infoblox_ipv4_network.net2.cidr
}
// dynamic allocation of both IPv4 and IPv6 host records using filter_params with aliases
resource "infoblox_ip_allocation" "rec_host17" {
fqdn = "new777.test.com"
aliases = ["www.test.com"]
disable = false
//Extensible attributes of parent network
filter_params = jsonencode({
"*Site": "Turkey"
})
ip_address_type = "Both"
enable_dns = true
ttl = 60
}
```
19 changes: 19 additions & 0 deletions docs/resources/infoblox_ipv4_network.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,16 @@ The following list describes the parameters you can define in a `infoblox_ipv4_n
* `gateway`: optional, defines the IP address of the gateway within the network block. If a value is not set, the first IP address of the allocated network is assigned as the gateway address. If the value of the gateway parameter is set as `none`, no value is assigned.
* `ext_attrs`: optional, specifies the set of NIOS extensible attributes that will be attached to the network.
* `reserve_ip`: optional, specifies the number of IPv4 addresses that you want to reserve in the IPv4 network. The default value is 0
* `filter_params`: optional, specifies the extensible attributes of the parent network or network container that must be used as filters to retrieve the next available network for creating the network object. Example: `jsonencode({"*Site": "Turkey"})`.
* `object`: optional, specifies the type of object from which to allocate the network. The values can be `network` or `networkcontainer`. The default value is `networkcontainer`.

!> Once a network object is created, the `reserve_ip` and `gateway` fields cannot be edited.

!> IP addresses that are reserved by setting the `reserve_ip` field are used for network maintenance by the cloud providers. Therefore, Infoblox does not recommend using these IP addresses for other purposes.

!> The object parameter is applicable only if filter_params is configured.
!> If the object parameter is set to network, after the creation of the network object, the parent network object will be converted to a network container object.

### Examples of an IPv4 Network Block

```hcl
Expand Down Expand Up @@ -50,4 +55,18 @@ resource "infoblox_ipv4_network" "net3" {
"Site" = "any place you wish ..."
})
}
// full set of parameters for dynamically allocated IPv4 network using next-available
resource "infoblox_ipv4_network" "ipv4network1" {
allocate_prefix_len = 26
network_view = "nondefault_netview"
comment = "IPV4 NW within a NW container"
filter_params = jsonencode({
"*Site": "Blr"
})
ext_attrs = jsonencode({
"Site" = "UK"
})
object = "networkcontainer"
}
```
12 changes: 11 additions & 1 deletion docs/resources/infoblox_ipv4_network_container.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ resource block:
* `allocate_prefix_len`: required only if `parent_cidr` is set, defines length of netmask for a network container that should be allocated from network container, determined by `parent_cidr`.
* `comment`: optional, describes the network container.
* `ext_attrs`: optional, specifies the set of NIOS extensible attributes that will be attached to the network container.
* `filter_params`: required for dynamic allocation when `parent_cidr` is not used, specifies the extensible attributes of the parent network container that must be used as filters to retrieve the next available network for creating the network container object. Example: `jsonencode({"*Site": "Turkey"})`.

!> Once the network container is created, the `network_view` and `cidr` parameter values cannot be changed by performing an `update` operation.

!> Once the network container is created dynamically, the `parent_cidr` and `allocate_prefix_len` parameter values cannot be changed.
!> Once the network container is created dynamically, the `parent_cidr`, `filter_params` and `allocate_prefix_len` parameter values cannot be changed.

### Examples of the Network Container Resource

Expand Down Expand Up @@ -47,4 +48,13 @@ resource "infoblox_ipv4_network_container" "v4net_c3" {
"Country" = "Australia"
})
}
// dynamic allocation of IPv4 network container resource using filter_params
resource "infoblox_ipv4_network_container" "network_container_ipv4" {
allocate_prefix_len = 26
comment = "IPv4 network container created with next available network"
filter_params = jsonencode({
"*Site": "Blr"
})
}
```
20 changes: 20 additions & 0 deletions docs/resources/infoblox_ipv6_network.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,16 @@ The following list describes the parameters you can define in a `infoblox_ipv6_n
* `gateway`: optional, defines the IP address of the gateway within the network block. If a value is not set, the first IP address of the allocated network is assigned as the gateway address. If the value of the gateway parameter is set as `none`, no value is assigned.
* `ext_attrs`: optional, specifies the set of NIOS extensible attributes that will be attached to the network.
* `reserve_ipv6`: optional, specifies the number of IPv6 addresses that you want to reserve in the IPv6 network. The default value is 0
* `filter_params`: optional, specifies the extensible attributes of the parent network or network container that must be used as filters to retrieve the next available network for creating the network object. Example: `jsonencode({"*Site": "Turkey"})`.
* `object`: optional, specifies the type of object from which to allocate the network. The values can be `network` or `networkcontainer`. The default value is `networkcontainer`.

!> Once a network object is created, the `reserve_ipv6` and `gateway` fields cannot be edited.

!> IP addresses that are reserved by setting the `reserve_ipv6` field are used for network maintenance by the cloud providers. Therefore, Infoblox does not recommend using these IP addresses for other purposes.

!> The object parameter is applicable only if filter_params is configured.
!> If the object parameter is set to network, after the creation of the network object, the parent network object will be converted to a network container object.

### Examples of an IPv6 Network Block

```hcl
Expand Down Expand Up @@ -50,4 +55,19 @@ resource "infoblox_ipv6_network" "net3" {
"Site" = "small inner cluster"
})
}
//full set of parameters for dynamically allocated IPv6 network using filter_params
resource "infoblox_ipv6_network" "ipv6network1" {
allocate_prefix_len = 67
network_view = "nondefault_netview"
comment = "IPV6 NW within a NW container"
filter_params = jsonencode({
"*Site": "Blr"
})
ext_attrs = jsonencode({
"Site" = "UK"
})
object = "networkcontainer"
}
```
Loading

0 comments on commit 1a5836e

Please sign in to comment.