Skip to content

Commit

Permalink
more fixes for the documentation and the examples
Browse files Browse the repository at this point in the history
  • Loading branch information
skudriavtsev committed Apr 12, 2023
1 parent 400332b commit 61ec917
Show file tree
Hide file tree
Showing 17 changed files with 131 additions and 25 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,5 +106,5 @@ The limitations of Infoblox IPAM Plug-In for Terraform version 2.3.0 are as foll
* `infoblox_ipv6_allocation`
* `infoblox_ipv4_association`
* `infoblox_ipv6_association`
* The Update functionality is currently not working for the CIDR field in A, AAAA, and PTR records.
* The Update functionality is currently not working for the CIDR field in A and AAAA records.
* The fetch functionality in data sources returns output for only one matching object even if it finds multiple objects matching the search criteria.
18 changes: 17 additions & 1 deletion docs/data-sources/infoblox_a_record.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,26 @@ You can reference this resource and retrieve information about it. For example,
a text as is a comment for the A-record.

```hcl
resource "infoblox_a_record" "vip_host" {
fqdn = "very-interesting-host.example.com"
ip_addr = "10.3.1.65"
comment = "special host"
dns_view = "nondefault_dnsview2"
ttl = 120 // 120s
ext_attrs = jsonencode({
"Location" = "65.8665701230204, -37.00791763398113"
})
}
data "infoblox_a_record" "vip_host" {
dns_view="default"
dns_view="nondefault_dnsview2"
fqdn="very-interesting-host.example.com"
ip_addr="10.3.1.65"
// This is just to ensure that the record has been be created
// using 'infoblox_a_record' resource block before the data source will be queried.
depends_on = [infoblox_a_record.vip_host]
}
output "vip_host_id" {
Expand Down
15 changes: 14 additions & 1 deletion docs/data-sources/infoblox_aaaa_record.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,23 @@ You can reference this resource and retrieve information about it. For example,
a text as is a comment for the AAAA-record.

```hcl
resource "infoblox_aaaa_record" "vip_host" {
fqdn = "very-interesting-host.example.com"
ipv6_addr = "2a05:d014:275:cb00:ec0d:12e2:df27:aa60"
comment = "some comment"
ttl = 120 // 120s
ext_attrs = jsonencode({
"Location" = "65.8665701230204, -37.00791763398113"
})
}
data "infoblox_aaaa_record" "vip_host" {
dns_view="default"
fqdn="very-interesting-host.example.com"
ipv6_addr="2a05:d014:275:cb00:ec0d:12e2:df27:aa60"
// This is just to ensure that the record has been be created
// using 'infoblox_aaaa_record' resource block before the data source will be queried.
depends_on = [infoblox_aaaa_record.vip_host]
}
output "vip_host_id" {
Expand Down
18 changes: 17 additions & 1 deletion docs/data-sources/infoblox_cname_record.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,26 @@ The following list describes the parameters you must define in an `infoblox_cnam
### Example of the CNAME-record Data Source Block

```hcl
resource "infoblox_cname_record" "foo" {
dns_view = "default.nondefault_netview"
canonical = "strange-place.somewhere.in.the.net"
alias = "foo.test.com"
comment = "we need to keep an eye on this strange host"
ttl = 0 // disable caching
ext_attrs = jsonencode({
Site = "unknown"
Location = "TBD"
})
}
data "infoblox_cname_record" "foo"{
dns_view="default"
dns_view="default.nondefault_netview"
alias="foo.test.com"
canonical="main.test.com"
// This is just to ensure that the record has been be created
// using 'infoblox_cname_record' resource block before the data source will be queried.
depends_on = [infoblox_cname_record.foo]
}
output "foo_ttl" {
Expand Down
17 changes: 16 additions & 1 deletion docs/data-sources/infoblox_ipv4_network.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,24 @@ The following list describes the parameters you must define in an `infoblox_ipv4
### Example of a Network Data Source Block

```hcl
resource "infoblox_ipv4_network" "net2" {
cidr = "192.168.128.0/20"
network_view = "nondefault_netview"
reserve_ip = 5
gateway = "192.168.128.254"
comment = "small network for testing"
ext_attrs = jsonencode({
"Site" = "bla-bla-bla... testing..."
})
}
data "infoblox_ipv4_network" "nearby_network" {
network_view = "default"
network_view = "nondefault_netview"
cidr = "192.168.128.0/20"
// This is just to ensure that the network has been be created
// using 'infoblox_ipv4_network' resource block before the data source will be queried.
depends_on = [infoblox_ipv4_network.net2]
}
output "nearby_network_comment" {
Expand Down
14 changes: 14 additions & 0 deletions docs/data-sources/infoblox_ipv4_network_container.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,23 @@ in an `infoblox_ipv4_network_container` data source block (all of them are requi
### Example of an IPv4 Network Container Data Source Block

```hcl
resource "infoblox_ipv4_network_container" "nearby_org" {
cidr = "192.168.128.0/16"
network_view = "separate_tenants"
comment = "one of our clients"
ext_attrs = jsonencode({
"Site" = "remote office"
"Country" = "Australia"
})
}
data "infoblox_ipv4_network_container" "nearby_org" {
network_view = "separate_tenants"
cidr = "192.168.128.0/16"
// This is just to ensure that the network container has been be created
// using 'infoblox_ipv4_network_container' resource block before the data source will be queried.
depends_on = [infoblox_ipv4_network_container.nearby_org]
}
output "nearby_org_comment" {
Expand Down
26 changes: 14 additions & 12 deletions docs/data-sources/infoblox_mx_record.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,24 @@ data "infoblox_mx_record" "ds2" {
mail_exchanger = "sample.test.com"
preference = 40
// This is just to ensure that the record has been be created
// using 'infoblox_mx_record' resource block before the data source will be queried.
depends_on = [infoblox_mx_record.rec2]
}
output "mx_rec2_zone" {
value = data.infoblox_mx_record.ds2.zone
}
output "mx_rec2_zone" {
value = data.infoblox_mx_record.ds2.zone
}
output "mx_rec2_ttl" {
value = data.infoblox_mx_record.ds2.ttl
}
output "mx_rec2_ttl" {
value = data.infoblox_mx_record.ds2.ttl
}
output "mx_rec2_comment" {
value = data.infoblox_mx_record.ds2.comment
}
output "mx_rec2_comment" {
value = data.infoblox_mx_record.ds2.comment
}
output "mx_rec2_ext_attrs" {
value = data.infoblox_mx_record.ds2.ext_attrs
}
output "mx_rec2_ext_attrs" {
value = data.infoblox_mx_record.ds2.ext_attrs
}
```
12 changes: 12 additions & 0 deletions docs/data-sources/infoblox_network_view.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,20 @@ To get information about a network view, you must specify a name of the network
### Example of a Network View Data Source Block

```hcl
resource "infoblox_network_view" "inet_nv" {
name = "inet_visible_nv"
comment = "Internet-facing networks"
ext_attrs = jsonencode({
"Location" = "the North pole"
})
}
data "infoblox_network_view" "inet_nv" {
name = "inet_visible_nv"
// This is just to ensure that the network view has been be created
// using 'infoblox_network_view' resource block before the data source will be queried.
depends_on = [infoblox_network_view.inet_nv]
}
output "inet_nv_ext_attrs" {
Expand Down
14 changes: 14 additions & 0 deletions docs/data-sources/infoblox_ptr_record.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,24 @@ You can reference this resource and retrieve information about it. For example,
`data.infoblox_ptr_record.vip_host.comment` returns a textual content of comment field for the PTR-record.

```hcl
resource "infoblox_ptr_record" "host1" {
ptrdname = "host.example.org"
ip_addr = "2a05:d014:275:cb00:ec0d:12e2:df27:aa60"
comment = "workstation #3"
ttl = 300 # 5 minutes
ext_attrs = jsonencode({
"Location" = "the main office"
})
}
data "infoblox_ptr_record" "host1" {
// dns_view="default" // may be omitted
ptrdname="host.example.org"
ip_addr="2a05:d014:275:cb00:ec0d:12e2:df27:aa60"
// This is just to ensure that the record has been be created
// using 'infoblox_ptr_record' resource block before the data source will be queried.
depends_on = [infoblox_ptr_record.host1]
}
output "host1_id" {
Expand Down
4 changes: 3 additions & 1 deletion docs/data-sources/infoblox_srv_record.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,13 @@ resource "infoblox_srv_record" "rec2" {
}
data "infoblox_srv_record" "ds1" {
dns_view = "nondefault_dnsview1" // not 'default' thus must be specified
dns_view = "nondefault_dnsview1"
name = "_sip._udp.example2.org"
port = 5060
target = "sip.example2.org"
// This is just to ensure that the record has been be created
// using 'infoblox_srv_record' resource block before the data source will be queried.
depends_on = [infoblox_srv_record.rec2]
}
Expand Down
4 changes: 3 additions & 1 deletion docs/data-sources/infoblox_txt_record.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ resource "infoblox_txt_record" "rec3" {
}
data "infoblox_txt_record" "ds3" {
dns_view = "nondefault_dnsview1" // not 'default' thus must be specified
dns_view = "nondefault_dnsview1"
fqdn = "example3.example2.org"
// This is just to ensure that the record has been be created
// using 'infoblox_txt_record' resource block before the data source will be queried.
depends_on = [infoblox_txt_record.rec3]
}
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/infoblox_srv_record.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ resource "infoblox_srv_record" "rec1" {
// all set of parameters for SRV record
resource "infoblox_srv_record" "rec2" {
dns_view = "nondefault_dnsview1" // not 'default' thus must be specified
dns_view = "nondefault_dnsview1"
name = "_sip._udp.example2.org"
priority = 12
weight = 10
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/infoblox_txt_record.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ resource "infoblox_txt_record" "rec2" {
// all the parameters for a TXT-Record
resource "infoblox_txt_record" "rec3" {
dns_view = "nondefault_dnsview1" // not 'default' thus must be specified
dns_view = "nondefault_dnsview1"
fqdn = "example3.example2.org"
text = "data for TXT-record #3"
ttl = 300
Expand Down
2 changes: 1 addition & 1 deletion examples/datasources/infoblox_ipv4_network.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
data "infoblox_ipv4_network" "net1" {
cidr = "10.1.0.0/24"
network_view = "nondefault_netview" // optional, but it differs from 'default'
network_view = "nondefault_netview"

depends_on = [infoblox_ipv4_network.net1]
}
2 changes: 1 addition & 1 deletion examples/datasources/infoblox_ipv4_network_container.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
data "infoblox_ipv4_network_container" "nc2" {
cidr = "10.2.0.0/24"
network_view = "nondefault_netview" // optional, but it differs from 'default'
network_view = "nondefault_netview"

depends_on = [infoblox_ipv4_network_container.nc2]
}
2 changes: 1 addition & 1 deletion examples/resources/infoblox_srv_record.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ resource "infoblox_srv_record" "rec1" {

// all set of parameters for SRV record
resource "infoblox_srv_record" "rec2" {
dns_view = "nondefault_dnsview1" // not 'default' thus must be specified
dns_view = "nondefault_dnsview1"
name = "_sip._udp.example2.org"
priority = 12
weight = 10
Expand Down
2 changes: 1 addition & 1 deletion examples/resources/infoblox_txt_record.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ resource "infoblox_txt_record" "rec2" {

// all the parameters for a TXT-Record
resource "infoblox_txt_record" "rec3" {
dns_view = "nondefault_dnsview1" // not 'default' thus must be specified
dns_view = "nondefault_dnsview1"
fqdn = "example3.example2.org"
text = "data for TXT-record #3"
ttl = 300
Expand Down

0 comments on commit 61ec917

Please sign in to comment.