Skip to content

Commit

Permalink
Added acceptance test for Dhcp options in various resources that supp…
Browse files Browse the repository at this point in the history
…orts it (#65)
  • Loading branch information
AnilGadiyarHJ authored Feb 15, 2024
1 parent fc8252f commit 0faa944
Show file tree
Hide file tree
Showing 18 changed files with 744 additions and 6 deletions.
15 changes: 15 additions & 0 deletions docs/resources/dhcp_fixed_address.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ resource "bloxone_ipam_subnet" "example" {
}
}
data "bloxone_dhcp_option_codes" "option_code" {
filters = {
name = "domain-name-servers"
}
}
resource "bloxone_dhcp_fixed_address" "example_fixed_address" {
name = "example_fixed_address"
address = "192.168.1.1"
Expand All @@ -55,6 +62,14 @@ resource "bloxone_dhcp_fixed_address" "example_fixed_address" {
tags = {
location = "site1"
}
//dhcp options
dhcp_options = [
{
option_code = data.bloxone_dhcp_option_codes.option_code.results.0.id
option_value = "10.0.0.1"
type = "option"
}
]
depends_on = [bloxone_ipam_subnet.example]
}
Expand Down
15 changes: 15 additions & 0 deletions docs/resources/dhcp_server.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ resource "bloxone_dhcp_server" "example" {
name = "example_dhcp_server"
}
data "bloxone_dhcp_option_codes" "option_code" {
filters = {
name = "domain-name-servers"
}
}
resource "bloxone_dhcp_server" "example_with_options" {
name = "example_dhcp_server_with_options"
Expand All @@ -28,6 +34,15 @@ resource "bloxone_dhcp_server" "example_with_options" {
tags = {
site = "Site A"
}
//dhcp options
dhcp_options = [
{
option_code = data.bloxone_dhcp_option_codes.option_code.results.0.id
option_value = "10.0.0.1"
type = "option"
}
]
}
```

Expand Down
15 changes: 15 additions & 0 deletions docs/resources/ipam_address_block.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,26 @@ resource "bloxone_ipam_ip_space" "example" {
}
}
data "bloxone_dhcp_option_codes" "option_code" {
filters = {
name = "domain-name-servers"
}
}
resource "bloxone_ipam_address_block" "example" {
address = "192.168.1.0"
cidr = 24
name = "example_address_block"
space = bloxone_ipam_ip_space.example.id
//dhcp options
dhcp_options = [
{
option_code = data.bloxone_dhcp_option_codes.option_code.results.0.id
option_value = "10.0.0.1"
type = "option"
}
]
}
resource "bloxone_ipam_address_block" "example_tags" {
Expand Down
15 changes: 15 additions & 0 deletions docs/resources/ipam_ip_space.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,27 @@ resource "bloxone_ipam_ip_space" "example" {
name = "example_ip_space"
}
data "bloxone_dhcp_option_codes" "option_code" {
filters = {
name = "domain-name-servers"
}
}
resource "bloxone_ipam_ip_space" "example_tags" {
name = "example_ip_space_tags"
comment = "Example IP space with tags created by the terraform provider"
tags = {
location = "site1"
}
//dhcp options
dhcp_options = [
{
option_code = data.bloxone_dhcp_option_codes.option_code.results.0.id
option_value = "10.0.0.1"
type = "option"
}
]
}
```

Expand Down
15 changes: 15 additions & 0 deletions docs/resources/ipam_range.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ resource "bloxone_ipam_ip_space" "example" {
}
}
data "bloxone_dhcp_option_codes" "option_code" {
filters = {
name = "domain-name-servers"
}
}
resource "bloxone_ipam_subnet" "example" {
name = "example"
space = bloxone_ipam_ip_space.example.id
Expand All @@ -33,6 +39,15 @@ resource "bloxone_ipam_subnet" "example" {
tags = {
location = "site1"
}
//dhcp options
dhcp_options = [
{
option_code = data.bloxone_dhcp_option_codes.option_code.results.0.id
option_value = "10.0.0.1"
type = "option"
}
]
}
resource "bloxone_ipam_range" "example" {
Expand Down
14 changes: 14 additions & 0 deletions docs/resources/ipam_subnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ resource "bloxone_ipam_address_block" "example" {
space = bloxone_ipam_ip_space.example.id
}
data "bloxone_dhcp_option_codes" "option_code" {
filters = {
name = "domain-name-servers"
}
}
# Static address
resource "bloxone_ipam_subnet" "example" {
address = "10.0.0.0"
Expand All @@ -38,6 +44,14 @@ resource "bloxone_ipam_subnet" "example" {
tags = {
site = "Site A"
}
//dhcp options
dhcp_options = [
{
option_code = data.bloxone_dhcp_option_codes.option_code.results.0.id
option_value = "10.0.0.1"
type = "option"
}
]
}
# Next available subnet
Expand Down
15 changes: 15 additions & 0 deletions examples/resources/bloxone_dhcp_fixed_address/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ resource "bloxone_ipam_subnet" "example" {
}
}

data "bloxone_dhcp_option_codes" "option_code" {
filters = {
name = "domain-name-servers"
}
}


resource "bloxone_dhcp_fixed_address" "example_fixed_address" {
name = "example_fixed_address"
address = "192.168.1.1"
Expand All @@ -37,6 +44,14 @@ resource "bloxone_dhcp_fixed_address" "example_fixed_address" {
tags = {
location = "site1"
}
//dhcp options
dhcp_options = [
{
option_code = data.bloxone_dhcp_option_codes.option_code.results.0.id
option_value = "10.0.0.1"
type = "option"
}
]
depends_on = [bloxone_ipam_subnet.example]
}

Expand Down
15 changes: 15 additions & 0 deletions examples/resources/bloxone_dhcp_server/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ resource "bloxone_dhcp_server" "example" {
name = "example_dhcp_server"
}

data "bloxone_dhcp_option_codes" "option_code" {
filters = {
name = "domain-name-servers"
}
}

resource "bloxone_dhcp_server" "example_with_options" {
name = "example_dhcp_server_with_options"

Expand All @@ -10,4 +16,13 @@ resource "bloxone_dhcp_server" "example_with_options" {
tags = {
site = "Site A"
}

//dhcp options
dhcp_options = [
{
option_code = data.bloxone_dhcp_option_codes.option_code.results.0.id
option_value = "10.0.0.1"
type = "option"
}
]
}
15 changes: 15 additions & 0 deletions examples/resources/bloxone_ipam_address_block/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,26 @@ resource "bloxone_ipam_ip_space" "example" {
}
}

data "bloxone_dhcp_option_codes" "option_code" {
filters = {
name = "domain-name-servers"
}
}

resource "bloxone_ipam_address_block" "example" {
address = "192.168.1.0"
cidr = 24
name = "example_address_block"
space = bloxone_ipam_ip_space.example.id

//dhcp options
dhcp_options = [
{
option_code = data.bloxone_dhcp_option_codes.option_code.results.0.id
option_value = "10.0.0.1"
type = "option"
}
]
}

resource "bloxone_ipam_address_block" "example_tags" {
Expand Down
15 changes: 15 additions & 0 deletions examples/resources/bloxone_ipam_ip_space/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,25 @@ resource "bloxone_ipam_ip_space" "example" {
name = "example_ip_space"
}

data "bloxone_dhcp_option_codes" "option_code" {
filters = {
name = "domain-name-servers"
}
}

resource "bloxone_ipam_ip_space" "example_tags" {
name = "example_ip_space_tags"
comment = "Example IP space with tags created by the terraform provider"
tags = {
location = "site1"
}

//dhcp options
dhcp_options = [
{
option_code = data.bloxone_dhcp_option_codes.option_code.results.0.id
option_value = "10.0.0.1"
type = "option"
}
]
}
15 changes: 15 additions & 0 deletions examples/resources/bloxone_ipam_range/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ resource "bloxone_ipam_ip_space" "example" {
}
}

data "bloxone_dhcp_option_codes" "option_code" {
filters = {
name = "domain-name-servers"
}
}

resource "bloxone_ipam_subnet" "example" {
name = "example"
space = bloxone_ipam_ip_space.example.id
Expand All @@ -15,6 +21,15 @@ resource "bloxone_ipam_subnet" "example" {
tags = {
location = "site1"
}

//dhcp options
dhcp_options = [
{
option_code = data.bloxone_dhcp_option_codes.option_code.results.0.id
option_value = "10.0.0.1"
type = "option"
}
]
}

resource "bloxone_ipam_range" "example" {
Expand Down
14 changes: 14 additions & 0 deletions examples/resources/bloxone_ipam_subnet/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ resource "bloxone_ipam_address_block" "example" {
space = bloxone_ipam_ip_space.example.id
}

data "bloxone_dhcp_option_codes" "option_code" {
filters = {
name = "domain-name-servers"
}
}

# Static address
resource "bloxone_ipam_subnet" "example" {
address = "10.0.0.0"
Expand All @@ -20,6 +26,14 @@ resource "bloxone_ipam_subnet" "example" {
tags = {
site = "Site A"
}
//dhcp options
dhcp_options = [
{
option_code = data.bloxone_dhcp_option_codes.option_code.results.0.id
option_value = "10.0.0.1"
type = "option"
}
]
}

# Next available subnet
Expand Down
Loading

0 comments on commit 0faa944

Please sign in to comment.