Skip to content

Commit

Permalink
adding address_list attribute to ranges
Browse files Browse the repository at this point in the history
  • Loading branch information
techBeck03 committed May 6, 2022
1 parent 204fa68 commit 10047f3
Show file tree
Hide file tree
Showing 16 changed files with 97 additions and 29 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,5 @@ terraform

.env

dist/
dist/
test/
2 changes: 1 addition & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ signs:
- "${signature}"
- "--detach-sign"
- "${artifact}"
release:
# release:
# If you want to manually examine the release before its live, uncomment this line:
# draft: true
changelog:
Expand Down
3 changes: 2 additions & 1 deletion docs/data-sources/range.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ data "infoblox_range" "range" {

```terraform
data "infoblox_range" "range" {
ref = "range/867530986753098675309867530986753098675309867530986753098675309:172.19.4.2/172.19.4.10/default/default"no
ref = "range/867530986753098675309867530986753098675309867530986753098675309:172.19.4.2/172.19.4.10/default/default"
}
```

## Attributes Reference

The following attributes are exported.

- `address_list` - (Computed) The list of IP Addresses associated with this range
- `cidr` - (MutuallyExclusiveGroup*/Computed, String) The network to which this range belongs, in IPv4 Address/CIDR format.
- `comment` - (Computed, String) Comment for the range; maximum 256 characters.
- `disable_dhcp` - (Computed, Bool) Disable for DHCP.
Expand Down
1 change: 1 addition & 0 deletions docs/resources/range.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ resource "infoblox_range" "specified_range" {

The following attributes are exported.

- `address_list` - (Computed) The list of IP Addresses associated with this range
- `cidr` - (Required, String) The network to which this range belongs, in IPv4 Address/CIDR format.
- `comment` - (Optional, String) Comment for the range; maximum 256 characters.
- `disable_dhcp` - (Optional, Bool) Disable for DHCP.
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ require (
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320
github.com/hashicorp/terraform-plugin-sdk/v2 v2.4.3
github.com/techBeck03/go-ipmath v0.0.8
github.com/techBeck03/infoblox-go-sdk v1.0.1
github.com/techBeck03/infoblox-go-sdk v1.0.7
github.com/tidwall/gjson v1.9.3
)
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,8 @@ github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/techBeck03/go-ipmath v0.0.8 h1:U/z7bYt+92I/VpbJvpW48+hnPC0rOmvLuyEuiURNeWw=
github.com/techBeck03/go-ipmath v0.0.8/go.mod h1:VugtTa3vBBdfSTeYQQov/NzzXt40R+LtuFr15KWUhpY=
github.com/techBeck03/infoblox-go-sdk v1.0.1 h1:Em+53efxhKUmB05+QbQHQdWJIpaljp7On+8K21ApekI=
github.com/techBeck03/infoblox-go-sdk v1.0.1/go.mod h1:miTvClw8XenPYZ9psw+71AmtlPmY2Lu0EPLBWJ0JIQw=
github.com/techBeck03/infoblox-go-sdk v1.0.7 h1:cH5F4QziYDuzA9i7KAl4CTMiuerWJzFB2dh8CRnbtQE=
github.com/techBeck03/infoblox-go-sdk v1.0.7/go.mod h1:hsKceL3PHHxRlGbOvZnsjC3KZ9bPCzCgaFWrWSSAUEA=
github.com/tidwall/gjson v1.9.3 h1:hqzS9wAHMO+KVBBkLxYdkEeeFHuqr95GfClRLKlgK0E=
github.com/tidwall/gjson v1.9.3/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA=
Expand Down
8 changes: 8 additions & 0 deletions infoblox/data_range.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ func dataSourceRange() *schema.Resource {
return &schema.Resource{
ReadContext: dataSourceRangeRead,
Schema: map[string]*schema.Schema{
"address_list": {
Type: schema.TypeList,
Description: "The list of IP Addresses associated with this range",
Computed: true,
Elem: &schema.Schema{
Type: schema.TypeString,
},
},
"cidr": {
Type: schema.TypeString,
Description: "The network to which this range belongs, in IPv4 Address/CIDR format.",
Expand Down
9 changes: 9 additions & 0 deletions infoblox/resource_range.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ func resourceRange() *schema.Resource {
makeGTIPCheck("start_address", "end_address"),
),
Schema: map[string]*schema.Schema{
"address_list": {
Type: schema.TypeList,
Description: "The list of IP Addresses associated with this range",
Computed: true,
Elem: &schema.Schema{
Type: schema.TypeString,
},
},
"cidr": {
Type: schema.TypeString,
Description: "The network to which this range belongs, in IPv4 Address/CIDR format.",
Expand Down Expand Up @@ -217,6 +225,7 @@ func convertRangeToResourceData(client *infoblox.Client, d *schema.ResourceData,
d.Set("range_function_string", fmt.Sprintf("%s-%s", addressRange.StartAddress, addressRange.EndAddress))
d.Set("network_view", addressRange.NetworkView)
d.Set("disable_dhcp", addressRange.DisableDHCP)
d.Set("address_list", addressRange.IPAddressList)

var memberList []map[string]interface{}
if addressRange.Member != nil {
Expand Down
2 changes: 2 additions & 0 deletions vendor/github.com/techBeck03/infoblox-go-sdk/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion vendor/github.com/techBeck03/infoblox-go-sdk/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions vendor/github.com/techBeck03/infoblox-go-sdk/go.mod

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions vendor/github.com/techBeck03/infoblox-go-sdk/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 11 additions & 11 deletions vendor/github.com/techBeck03/infoblox-go-sdk/ipv4address.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 46 additions & 10 deletions vendor/github.com/techBeck03/infoblox-go-sdk/range.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions vendor/github.com/techBeck03/infoblox-go-sdk/types.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ github.com/oklog/run
# github.com/techBeck03/go-ipmath v0.0.8
## explicit
github.com/techBeck03/go-ipmath
# github.com/techBeck03/infoblox-go-sdk v1.0.1
# github.com/techBeck03/infoblox-go-sdk v1.0.7
## explicit
github.com/techBeck03/infoblox-go-sdk
# github.com/tidwall/gjson v1.9.3
Expand Down

0 comments on commit 10047f3

Please sign in to comment.