Skip to content

Commit

Permalink
feat: add ress/data cloudavenue_vdcg_network_isolated
Browse files Browse the repository at this point in the history
  • Loading branch information
azrod committed Dec 13, 2024
1 parent 6760dfa commit ee81243
Show file tree
Hide file tree
Showing 22 changed files with 1,581 additions and 5 deletions.
7 changes: 7 additions & 0 deletions .changelog/878.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
```release-note:new-resource
`resource/cloudavenue_vdcg_network_isolated` - Added a new resource to manage isolated networks in a VDC Group.
```

```release-note:new-data-source
`datasource/cloudavenue_vdcg_network_isolated` - Added a new data source to fetch information about an isolated network in a VDC Group.
```
44 changes: 44 additions & 0 deletions docs/data-sources/vdcg_network_isolated
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
page_title: "cloudavenue_vdcg_network_isolated Data Source - cloudavenue"
subcategory: "vDC Group (Virtual Datacenter Group)"
description: |-
The cloudavenue_vdcg_network_isolated data source allows you to retrieve information about an isolated network in a VDC Group.
---

# cloudavenue_vdcg_network_isolated (Data Source)

The `cloudavenue_vdcg_network_isolated` data source allows you to retrieve information about an isolated network in a `VDC Group`.



<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `name` (String) The name of the network. This value must be unique within the `VDC` that owns the network.

### Optional

- `vdc_group_id` (String) The ID of vDC group that owns the network. Ensure that at least one attribute from this collection is set: [vdc_group_name,vdc_group_id].
- `vdc_group_name` (String) The name of vDC group that owns the network. Ensure that at least one attribute from this collection is set: [vdc_group_name,vdc_group_id].

### Read-Only

- `description` (String) A description of the network.
- `dns1` (String) The primary DNS server IP address for the network.
- `dns2` (String) The secondary DNS server IP address for the network.
- `dns_suffix` (String) The DNS suffix for the network.
- `gateway` (String) The gateway IP address for the network. This value define also the network IP range with the prefix length.
- `guest_vlan_allowed` (Boolean) Indicates if the network allows guest VLANs.
- `id` (String) The ID of the isolated network.
- `prefix_length` (Number) The prefix length for the network. This value must be a valid prefix length for the network IP range. (e.g. /24 for netmask 255.255.255.0).
- `static_ip_pool` (Attributes Set) A set of static IP pools to be used for this network. (see [below for nested schema](#nestedatt--static_ip_pool))

<a id="nestedatt--static_ip_pool"></a>
### Nested Schema for `static_ip_pool`

Read-Only:

- `end_address` (String) The end address of the IP pool. This value must be a valid IP address in the network IP range.
- `start_address` (String) The start address of the IP pool. This value must be a valid IP address in the network IP range.
45 changes: 45 additions & 0 deletions docs/data-sources/vdcg_network_isolated.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "cloudavenue_vdcg_network_isolated Data Source - cloudavenue"
subcategory: ""
description: |-
The cloudavenue_vdcg_network_isolated data source allows you to retrieve information about an isolated network in a VDC Group.
---

# cloudavenue_vdcg_network_isolated (Data Source)

The `cloudavenue_vdcg_network_isolated` data source allows you to retrieve information about an isolated network in a `VDC Group`.



<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `name` (String) The name of the network. This value must be unique within the `VDC` that owns the network.

### Optional

- `vdc_group_id` (String) The ID of vDC group that owns the network. Ensure that at least one attribute from this collection is set: [vdc_group_name,vdc_group_id].
- `vdc_group_name` (String) The name of vDC group that owns the network. Ensure that at least one attribute from this collection is set: [vdc_group_name,vdc_group_id].

### Read-Only

- `description` (String) A description of the network.
- `dns1` (String) The primary DNS server IP address for the network.
- `dns2` (String) The secondary DNS server IP address for the network.
- `dns_suffix` (String) The DNS suffix for the network.
- `gateway` (String) The gateway IP address for the network. This value define also the network IP range with the prefix length.
- `guest_vlan_allowed` (Boolean) Indicates if the network allows guest VLANs.
- `id` (String) The ID of the isolated network.
- `prefix_length` (Number) The prefix length for the network. This value must be a valid prefix length for the network IP range. (e.g. /24 for netmask 255.255.255.0).
- `static_ip_pool` (Attributes Set) A set of static IP pools to be used for this network. (see [below for nested schema](#nestedatt--static_ip_pool))

<a id="nestedatt--static_ip_pool"></a>
### Nested Schema for `static_ip_pool`

Read-Only:

- `end_address` (String) The end address of the IP pool. This value must be a valid IP address in the network IP range.
- `start_address` (String) The start address of the IP pool. This value must be a valid IP address in the network IP range.
66 changes: 66 additions & 0 deletions docs/resources/vdcg_network_isolated
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
page_title: "cloudavenue_vdcg_network_isolated Resource - cloudavenue"
subcategory: "vDC Group (Virtual Datacenter Group)"
description: |-
The cloudavenue_vdcg_network_isolated resource allows you to manage an isolated network in a VDC Group.
---

# cloudavenue_vdcg_network_isolated (Resource)

The `cloudavenue_vdcg_network_isolated` resource allows you to manage an isolated network in a `VDC Group`.

## Example Usage

```terraform
resource "cloudavenue_vdcg_network_isolated" "example" {
name = "my-isolated-network"
vdc_group_name = cloudavenue_vdcg.example.name

gateway = "192.168.0.1"
prefix_length = 24

dns1 = "192.168.0.2"
dns2 = "192.168.0.3"
dns_suffix = "example.local"
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `gateway` (String) (ForceNew) The gateway IP address for the network. This value define also the network IP range with the prefix length. Must be a valid IP with net.ParseIP.
- `name` (String) The name of the network. This value must be unique within the `VDC` that owns the network.
- `prefix_length` (Number) (ForceNew) The prefix length for the network. This value must be a valid prefix length for the network IP range. (e.g. /24 for netmask 255.255.255.0). Value must be between 1 and 32.

### Optional

- `description` (String) A description of the network.
- `dns1` (String) The primary DNS server IP address for the network. Must be a valid IP with net.ParseIP.
- `dns2` (String) The secondary DNS server IP address for the network. Must be a valid IP with net.ParseIP.
- `dns_suffix` (String) The DNS suffix for the network.
- `guest_vlan_allowed` (Boolean) Indicates if the network allows guest VLANs. Value defaults to `false`.
- `static_ip_pool` (Attributes Set) A set of static IP pools to be used for this network. (see [below for nested schema](#nestedatt--static_ip_pool))
- `vdc_group_id` (String) (ForceNew) The ID of vDC group that owns the network. Ensure that at least one attribute from this collection is set: [vdc_group_name,vdc_group_id].
- `vdc_group_name` (String) (ForceNew) The name of vDC group that owns the network. Ensure that at least one attribute from this collection is set: [vdc_group_name,vdc_group_id].

### Read-Only

- `id` (String) The ID of the isolated network.

<a id="nestedatt--static_ip_pool"></a>
### Nested Schema for `static_ip_pool`

Required:

- `end_address` (String) The end address of the IP pool. This value must be a valid IP address in the network IP range. Must be a valid IP with net.ParseIP.
- `start_address` (String) The start address of the IP pool. This value must be a valid IP address in the network IP range. Must be a valid IP with net.ParseIP.

## Import

Import is supported using the following syntax:
```shell
# VDC Network isolated can be imported using the VDC Groupe name or ID and the network name or ID.
terraform import cloudavenue_vdcg_network_isolated.example vdcGroupNameOrId.networkNameOrId
```
68 changes: 68 additions & 0 deletions docs/resources/vdcg_network_isolated.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "cloudavenue_vdcg_network_isolated Resource - cloudavenue"
subcategory: ""
description: |-
The cloudavenue_vdcg_network_isolated resource allows you to manage an isolated network in a VDC Group.
---

# cloudavenue_vdcg_network_isolated (Resource)

The `cloudavenue_vdcg_network_isolated` resource allows you to manage an isolated network in a `VDC Group`.

## Example Usage

```terraform
resource "cloudavenue_vdcg_network_isolated" "example" {
name = "my-isolated-network"
vdc_group_name = cloudavenue_vdcg.example.name
gateway = "192.168.0.1"
prefix_length = 24
dns1 = "192.168.0.2"
dns2 = "192.168.0.3"
dns_suffix = "example.local"
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `gateway` (String) (ForceNew) The gateway IP address for the network. This value define also the network IP range with the prefix length. Must be a valid IP with net.ParseIP.
- `name` (String) The name of the network. This value must be unique within the `VDC` that owns the network.
- `prefix_length` (Number) (ForceNew) The prefix length for the network. This value must be a valid prefix length for the network IP range. (e.g. /24 for netmask 255.255.255.0). Value must be between 1 and 32.

### Optional

- `description` (String) A description of the network.
- `dns1` (String) The primary DNS server IP address for the network. Must be a valid IP with net.ParseIP.
- `dns2` (String) The secondary DNS server IP address for the network. Must be a valid IP with net.ParseIP.
- `dns_suffix` (String) The DNS suffix for the network.
- `guest_vlan_allowed` (Boolean) Indicates if the network allows guest VLANs. Value defaults to `false`.
- `static_ip_pool` (Attributes Set) A set of static IP pools to be used for this network. (see [below for nested schema](#nestedatt--static_ip_pool))
- `vdc_group_id` (String) (ForceNew) The ID of vDC group that owns the network. Ensure that at least one attribute from this collection is set: [vdc_group_name,vdc_group_id].
- `vdc_group_name` (String) (ForceNew) The name of vDC group that owns the network. Ensure that at least one attribute from this collection is set: [vdc_group_name,vdc_group_id].

### Read-Only

- `id` (String) The ID of the isolated network.

<a id="nestedatt--static_ip_pool"></a>
### Nested Schema for `static_ip_pool`

Required:

- `end_address` (String) The end address of the IP pool. This value must be a valid IP address in the network IP range. Must be a valid IP with net.ParseIP.
- `start_address` (String) The start address of the IP pool. This value must be a valid IP address in the network IP range. Must be a valid IP with net.ParseIP.

## Import

Import is supported using the following syntax:

```shell
# VDC Network isolated can be imported using the VDC Groupe name or ID and the network name or ID.
terraform import cloudavenue_vdcg_network_isolated.example vdcGroupNameOrId.networkNameOrId
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# VDC Network isolated can be imported using the VDC Groupe name or ID and the network name or ID.
terraform import cloudavenue_vdcg_network_isolated.example vdcGroupNameOrId.networkNameOrId
11 changes: 11 additions & 0 deletions examples/resources/cloudavenue_vdcg_network_isolated/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
resource "cloudavenue_vdcg_network_isolated" "example" {
name = "my-isolated-network"
vdc_group_name = cloudavenue_vdcg.example.name

gateway = "192.168.0.1"
prefix_length = 24

dns1 = "192.168.0.2"
dns2 = "192.168.0.3"
dns_suffix = "example.local"
}
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ require (
github.com/hashicorp/terraform-plugin-log v0.9.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.35.0
github.com/iancoleman/strcase v0.3.0
github.com/orange-cloudavenue/cloudavenue-sdk-go v0.15.1
github.com/orange-cloudavenue/cloudavenue-sdk-go v0.14.1-0.20241212084109-0015a69a610a
github.com/orange-cloudavenue/common-go/utils v0.0.0-20240119163616-66b473d92339
github.com/rs/zerolog v1.33.0
github.com/thanhpk/randstr v1.0.6
Expand All @@ -45,6 +45,7 @@ require (
github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect
github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de // indirect
github.com/armon/go-radix v1.0.0 // indirect
github.com/avast/retry-go/v4 v4.6.0 // indirect
github.com/bgentry/speakeasy v0.1.0 // indirect
github.com/bmatcuk/doublestar/v4 v4.7.1 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de h1:FxWPpzIjnTlhP
github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de/go.mod h1:DCaWoUhZrYW9p1lxo/cm8EmUOOzAPSEZNGF2DK1dJgw=
github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI=
github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
github.com/avast/retry-go/v4 v4.6.0 h1:K9xNA+KeB8HHc2aWFuLb25Offp+0iVRXEvFx8IinRJA=
github.com/avast/retry-go/v4 v4.6.0/go.mod h1:gvWlPhBVsvBbLkVGDg/KwvBv0bEkCOLRRSHKIr2PyOE=
github.com/aws/aws-sdk-go v1.31.9/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0=
github.com/aws/aws-sdk-go v1.55.5 h1:KKUZBfBoyqy5d3swXyiC7Q76ic40rYcbqH7qjh59kzU=
github.com/aws/aws-sdk-go v1.55.5/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU=
Expand Down Expand Up @@ -250,8 +252,6 @@ github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU=
github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE=
github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs=
github.com/orange-cloudavenue/cloudavenue-sdk-go v0.15.1 h1:8KZ2/hWbuDTY9KZqr0TBgwD0r702KcVXBC/FOW1opM8=
github.com/orange-cloudavenue/cloudavenue-sdk-go v0.15.1/go.mod h1:nUx8sNedkNajCoMo+oAEgBmcUnSJcxezoqhhliqKmMs=
github.com/orange-cloudavenue/common-go/utils v0.0.0-20240119163616-66b473d92339 h1:DEKcWLGbEhu/I6kn9NAXhVCFrbPhR+Ef7oLmpLVnnPM=
github.com/orange-cloudavenue/common-go/utils v0.0.0-20240119163616-66b473d92339/go.mod h1:11JAFfGWVmhoT4AAORKsIC5M6nI+uDGSEOScMzavgPA=
github.com/peterhellberg/link v1.2.0 h1:UA5pg3Gp/E0F2WdX7GERiNrPQrM1K6CVJUUWfHa4t6c=
Expand Down
1 change: 1 addition & 0 deletions internal/provider/provider_datasources.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func (p *cloudavenueProvider) DataSources(_ context.Context) []func() datasource

// * VDC GROUP
vdcg.NewVDCGDataSource,
vdcg.NewNetworkIsolatedDataSource,

// * VAPP
vapp.NewVappDataSource,
Expand Down
1 change: 1 addition & 0 deletions internal/provider/provider_resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ func (p *cloudavenueProvider) Resources(_ context.Context) []func() resource.Res

// * VDC Group
vdcg.NewVDCGResource,
vdcg.NewNetworkIsolatedResource,

// * VCDA
vcda.NewVCDAIPResource,
Expand Down
Loading

0 comments on commit ee81243

Please sign in to comment.