Skip to content

Commit 6b73d82

Browse files
authored
feat(sdn): add support for zone resources and datasources (#2046)
Signed-off-by: Pavel Boldyrev <[email protected]>
1 parent 757b191 commit 6b73d82

File tree

62 files changed

+3370
-8
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+3370
-8
lines changed

.golangci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ linters:
4444
gosec:
4545
excludes:
4646
- G115
47+
lll:
48+
line-length: 150
4749
revive:
4850
rules:
4951
- name: "package-comments"
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
layout: page
3+
title: proxmox_virtual_environment_sdn_zone_evpn
4+
parent: Data Sources
5+
subcategory: Virtual Environment
6+
description: |-
7+
Retrieves information about an EVPN Zone in Proxmox SDN. The EVPN zone creates a routable Layer 3 network, capable of spanning across multiple clusters.
8+
---
9+
10+
# Data Source: proxmox_virtual_environment_sdn_zone_evpn
11+
12+
Retrieves information about an EVPN Zone in Proxmox SDN. The EVPN zone creates a routable Layer 3 network, capable of spanning across multiple clusters.
13+
14+
## Example Usage
15+
16+
```terraform
17+
data "proxmox_virtual_environment_sdn_zone_evpn" "example" {
18+
id = "evpn1"
19+
}
20+
21+
output "data_proxmox_virtual_environment_sdn_zone_evpn" {
22+
value = {
23+
id = data.proxmox_virtual_environment_sdn_zone_evpn.example.id
24+
nodes = data.proxmox_virtual_environment_sdn_zone_evpn.example.nodes
25+
controller = data.proxmox_virtual_environment_sdn_zone_evpn.example.controller
26+
vrf_vxlan = data.proxmox_virtual_environment_sdn_zone_evpn.example.vrf_vxlan
27+
advertise_subnets = data.proxmox_virtual_environment_sdn_zone_evpn.example.advertise_subnets
28+
disable_arp_nd_suppression = data.proxmox_virtual_environment_sdn_zone_evpn.example.disable_arp_nd_suppression
29+
exit_nodes = data.proxmox_virtual_environment_sdn_zone_evpn.example.exit_nodes
30+
exit_nodes_local_routing = data.proxmox_virtual_environment_sdn_zone_evpn.example.exit_nodes_local_routing
31+
primary_exit_node = data.proxmox_virtual_environment_sdn_zone_evpn.example.primary_exit_node
32+
rt_import = data.proxmox_virtual_environment_sdn_zone_evpn.example.rt_import
33+
mtu = data.proxmox_virtual_environment_sdn_zone_evpn.example.mtu
34+
dns = data.proxmox_virtual_environment_sdn_zone_evpn.example.dns
35+
dns_zone = data.proxmox_virtual_environment_sdn_zone_evpn.example.dns_zone
36+
ipam = data.proxmox_virtual_environment_sdn_zone_evpn.example.ipam
37+
reverse_dns = data.proxmox_virtual_environment_sdn_zone_evpn.example.reverse_dns
38+
}
39+
}
40+
```
41+
42+
<!-- schema generated by tfplugindocs -->
43+
## Schema
44+
45+
### Required
46+
47+
- `id` (String) The unique identifier of the SDN zone.
48+
49+
### Read-Only
50+
51+
- `advertise_subnets` (Boolean) Enable subnet advertisement for EVPN.
52+
- `controller` (String) EVPN controller address.
53+
- `disable_arp_nd_suppression` (Boolean) Disable ARP/ND suppression for EVPN.
54+
- `dns` (String) DNS API server address.
55+
- `dns_zone` (String) DNS domain name. Used to register hostnames, such as `<hostname>.<domain>`. The DNS zone must already exist on the DNS server.
56+
- `exit_nodes` (Set of String) List of exit nodes for EVPN.
57+
- `exit_nodes_local_routing` (Boolean) Enable local routing for EVPN exit nodes.
58+
- `ipam` (String) IP Address Management system.
59+
- `mtu` (Number) MTU value for the zone.
60+
- `nodes` (Set of String) The Proxmox nodes which the zone and associated VNets are deployed on
61+
- `primary_exit_node` (String) Primary exit node for EVPN.
62+
- `reverse_dns` (String) Reverse DNS API server address.
63+
- `rt_import` (String) Route target import for EVPN. Must be in the format '<ASN>:<number>' (e.g., '65000:65000').
64+
- `vrf_vxlan` (Number) VRF VXLAN-ID used for dedicated routing interconnect between VNets. It must be different than the VXLAN-ID of the VNets.
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
layout: page
3+
title: proxmox_virtual_environment_sdn_zone_qinq
4+
parent: Data Sources
5+
subcategory: Virtual Environment
6+
description: |-
7+
Retrieves information about a QinQ Zone in Proxmox SDN. QinQ also known as VLAN stacking, that uses multiple layers of VLAN tags for isolation. The QinQ zone defines the outer VLAN tag (the Service VLAN) whereas the inner VLAN tag is defined by the VNet. Your physical network switches must support stacked VLANs for this configuration. Due to the double stacking of tags, you need 4 more bytes for QinQ VLANs. For example, you must reduce the MTU to 1496 if you physical interface MTU is 1500.
8+
---
9+
10+
# Data Source: proxmox_virtual_environment_sdn_zone_qinq
11+
12+
Retrieves information about a QinQ Zone in Proxmox SDN. QinQ also known as VLAN stacking, that uses multiple layers of VLAN tags for isolation. The QinQ zone defines the outer VLAN tag (the Service VLAN) whereas the inner VLAN tag is defined by the VNet. Your physical network switches must support stacked VLANs for this configuration. Due to the double stacking of tags, you need 4 more bytes for QinQ VLANs. For example, you must reduce the MTU to 1496 if you physical interface MTU is 1500.
13+
14+
## Example Usage
15+
16+
```terraform
17+
data "proxmox_virtual_environment_sdn_zone_qinq" "example" {
18+
id = "qinq1"
19+
}
20+
21+
output "data_proxmox_virtual_environment_sdn_zone_qinq" {
22+
value = {
23+
id = data.proxmox_virtual_environment_sdn_zone_qinq.example.id
24+
nodes = data.proxmox_virtual_environment_sdn_zone_qinq.example.nodes
25+
bridge = data.proxmox_virtual_environment_sdn_zone_qinq.example.bridge
26+
service_vlan = data.proxmox_virtual_environment_sdn_zone_qinq.example.service_vlan
27+
service_vlan_protocol = data.proxmox_virtual_environment_sdn_zone_qinq.example.service_vlan_protocol
28+
mtu = data.proxmox_virtual_environment_sdn_zone_qinq.example.mtu
29+
dns = data.proxmox_virtual_environment_sdn_zone_qinq.example.dns
30+
dns_zone = data.proxmox_virtual_environment_sdn_zone_qinq.example.dns_zone
31+
ipam = data.proxmox_virtual_environment_sdn_zone_qinq.example.ipam
32+
reverse_dns = data.proxmox_virtual_environment_sdn_zone_qinq.example.reverse_dns
33+
}
34+
}
35+
```
36+
37+
<!-- schema generated by tfplugindocs -->
38+
## Schema
39+
40+
### Required
41+
42+
- `id` (String) The unique identifier of the SDN zone.
43+
44+
### Read-Only
45+
46+
- `bridge` (String) A local, VLAN-aware bridge that is already configured on each local node
47+
- `dns` (String) DNS API server address.
48+
- `dns_zone` (String) DNS domain name. Used to register hostnames, such as `<hostname>.<domain>`. The DNS zone must already exist on the DNS server.
49+
- `ipam` (String) IP Address Management system.
50+
- `mtu` (Number) MTU value for the zone.
51+
- `nodes` (Set of String) The Proxmox nodes which the zone and associated VNets are deployed on
52+
- `reverse_dns` (String) Reverse DNS API server address.
53+
- `service_vlan` (Number) Service VLAN tag for QinQ. The tag must be between `1` and `4094`.
54+
- `service_vlan_protocol` (String) Service VLAN protocol for QinQ. The protocol must be `802.1ad` or `802.1q`.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
layout: page
3+
title: proxmox_virtual_environment_sdn_zone_simple
4+
parent: Data Sources
5+
subcategory: Virtual Environment
6+
description: |-
7+
Retrieves information about a Simple Zone in Proxmox SDN. It will create an isolated VNet bridge. This bridge is not linked to a physical interface, and VM traffic is only local on each the node. It can be used in NAT or routed setups.
8+
---
9+
10+
# Data Source: proxmox_virtual_environment_sdn_zone_simple
11+
12+
Retrieves information about a Simple Zone in Proxmox SDN. It will create an isolated VNet bridge. This bridge is not linked to a physical interface, and VM traffic is only local on each the node. It can be used in NAT or routed setups.
13+
14+
## Example Usage
15+
16+
```terraform
17+
data "proxmox_virtual_environment_sdn_zone_simple" "example" {
18+
id = "simple1"
19+
}
20+
21+
output "data_proxmox_virtual_environment_sdn_zone_simple" {
22+
value = {
23+
id = data.proxmox_virtual_environment_sdn_zone_simple.example.id
24+
nodes = data.proxmox_virtual_environment_sdn_zone_simple.example.nodes
25+
mtu = data.proxmox_virtual_environment_sdn_zone_simple.example.mtu
26+
dns = data.proxmox_virtual_environment_sdn_zone_simple.example.dns
27+
dns_zone = data.proxmox_virtual_environment_sdn_zone_simple.example.dns_zone
28+
ipam = data.proxmox_virtual_environment_sdn_zone_simple.example.ipam
29+
reverse_dns = data.proxmox_virtual_environment_sdn_zone_simple.example.reverse_dns
30+
}
31+
}
32+
```
33+
34+
<!-- schema generated by tfplugindocs -->
35+
## Schema
36+
37+
### Required
38+
39+
- `id` (String) The unique identifier of the SDN zone.
40+
41+
### Read-Only
42+
43+
- `dns` (String) DNS API server address.
44+
- `dns_zone` (String) DNS domain name. Used to register hostnames, such as `<hostname>.<domain>`. The DNS zone must already exist on the DNS server.
45+
- `ipam` (String) IP Address Management system.
46+
- `mtu` (Number) MTU value for the zone.
47+
- `nodes` (Set of String) The Proxmox nodes which the zone and associated VNets are deployed on
48+
- `reverse_dns` (String) Reverse DNS API server address.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
layout: page
3+
title: proxmox_virtual_environment_sdn_zone_vlan
4+
parent: Data Sources
5+
subcategory: Virtual Environment
6+
description: |-
7+
Retrieves information about a VLAN Zone in Proxmox SDN. It uses an existing local Linux or OVS bridge to connect to the node's physical interface. It uses VLAN tagging defined in the VNet to isolate the network segments. This allows connectivity of VMs between different nodes.
8+
---
9+
10+
# Data Source: proxmox_virtual_environment_sdn_zone_vlan
11+
12+
Retrieves information about a VLAN Zone in Proxmox SDN. It uses an existing local Linux or OVS bridge to connect to the node's physical interface. It uses VLAN tagging defined in the VNet to isolate the network segments. This allows connectivity of VMs between different nodes.
13+
14+
## Example Usage
15+
16+
```terraform
17+
data "proxmox_virtual_environment_sdn_zone_vlan" "example" {
18+
id = "vlan1"
19+
}
20+
21+
output "data_proxmox_virtual_environment_sdn_zone_vlan" {
22+
value = {
23+
id = data.proxmox_virtual_environment_sdn_zone_vlan.example.id
24+
nodes = data.proxmox_virtual_environment_sdn_zone_vlan.example.nodes
25+
bridge = data.proxmox_virtual_environment_sdn_zone_vlan.example.bridge
26+
mtu = data.proxmox_virtual_environment_sdn_zone_vlan.example.mtu
27+
dns = data.proxmox_virtual_environment_sdn_zone_vlan.example.dns
28+
dns_zone = data.proxmox_virtual_environment_sdn_zone_vlan.example.dns_zone
29+
ipam = data.proxmox_virtual_environment_sdn_zone_vlan.example.ipam
30+
reverse_dns = data.proxmox_virtual_environment_sdn_zone_vlan.example.reverse_dns
31+
}
32+
}
33+
```
34+
35+
<!-- schema generated by tfplugindocs -->
36+
## Schema
37+
38+
### Required
39+
40+
- `id` (String) The unique identifier of the SDN zone.
41+
42+
### Read-Only
43+
44+
- `bridge` (String) The local bridge or OVS switch, already configured on _each_ node that allows node-to-node connection.
45+
- `dns` (String) DNS API server address.
46+
- `dns_zone` (String) DNS domain name. Used to register hostnames, such as `<hostname>.<domain>`. The DNS zone must already exist on the DNS server.
47+
- `ipam` (String) IP Address Management system.
48+
- `mtu` (Number) MTU value for the zone.
49+
- `nodes` (Set of String) The Proxmox nodes which the zone and associated VNets are deployed on
50+
- `reverse_dns` (String) Reverse DNS API server address.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
layout: page
3+
title: proxmox_virtual_environment_sdn_zone_vxlan
4+
parent: Data Sources
5+
subcategory: Virtual Environment
6+
description: |-
7+
Retrieves information about a VXLAN Zone in Proxmox SDN. It establishes a tunnel (overlay) on top of an existing network (underlay). This encapsulates layer 2 Ethernet frames within layer 4 UDP datagrams using the default destination port 4789. You have to configure the underlay network yourself to enable UDP connectivity between all peers. Because VXLAN encapsulation uses 50 bytes, the MTU needs to be 50 bytes lower than the outgoing physical interface.
8+
---
9+
10+
# Data Source: proxmox_virtual_environment_sdn_zone_vxlan
11+
12+
Retrieves information about a VXLAN Zone in Proxmox SDN. It establishes a tunnel (overlay) on top of an existing network (underlay). This encapsulates layer 2 Ethernet frames within layer 4 UDP datagrams using the default destination port 4789. You have to configure the underlay network yourself to enable UDP connectivity between all peers. Because VXLAN encapsulation uses 50 bytes, the MTU needs to be 50 bytes lower than the outgoing physical interface.
13+
14+
## Example Usage
15+
16+
```terraform
17+
data "proxmox_virtual_environment_sdn_zone_vxlan" "example" {
18+
id = "vxlan1"
19+
}
20+
21+
output "data_proxmox_virtual_environment_sdn_zone_vxlan" {
22+
value = {
23+
id = data.proxmox_virtual_environment_sdn_zone_vxlan.example.id
24+
nodes = data.proxmox_virtual_environment_sdn_zone_vxlan.example.nodes
25+
peers = data.proxmox_virtual_environment_sdn_zone_vxlan.example.peers
26+
mtu = data.proxmox_virtual_environment_sdn_zone_vxlan.example.mtu
27+
dns = data.proxmox_virtual_environment_sdn_zone_vxlan.example.dns
28+
dns_zone = data.proxmox_virtual_environment_sdn_zone_vxlan.example.dns_zone
29+
ipam = data.proxmox_virtual_environment_sdn_zone_vxlan.example.ipam
30+
reverse_dns = data.proxmox_virtual_environment_sdn_zone_vxlan.example.reverse_dns
31+
}
32+
}
33+
```
34+
35+
<!-- schema generated by tfplugindocs -->
36+
## Schema
37+
38+
### Required
39+
40+
- `id` (String) The unique identifier of the SDN zone.
41+
42+
### Read-Only
43+
44+
- `dns` (String) DNS API server address.
45+
- `dns_zone` (String) DNS domain name. Used to register hostnames, such as `<hostname>.<domain>`. The DNS zone must already exist on the DNS server.
46+
- `ipam` (String) IP Address Management system.
47+
- `mtu` (Number) MTU value for the zone.
48+
- `nodes` (Set of String) The Proxmox nodes which the zone and associated VNets are deployed on
49+
- `peers` (Set of String) A list of IP addresses of each node in the VXLAN zone. This can be external nodes reachable at this IP address. All nodes in the cluster need to be mentioned here
50+
- `reverse_dns` (String) Reverse DNS API server address.
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
---
2+
layout: page
3+
title: proxmox_virtual_environment_sdn_zones
4+
parent: Data Sources
5+
subcategory: Virtual Environment
6+
description: |-
7+
Retrieves information about all SDN Zones in Proxmox. This data source can optionally filter zones by type.
8+
---
9+
10+
# Data Source: proxmox_virtual_environment_sdn_zones
11+
12+
Retrieves information about all SDN Zones in Proxmox. This data source can optionally filter zones by type.
13+
14+
## Example Usage
15+
16+
```terraform
17+
# List all SDN zones
18+
data "proxmox_virtual_environment_sdn_zones" "all" {}
19+
20+
# List only EVPN zones
21+
data "proxmox_virtual_environment_sdn_zones" "evpn_only" {
22+
type = "evpn"
23+
}
24+
25+
# List only Simple zones
26+
data "proxmox_virtual_environment_sdn_zones" "simple_only" {
27+
type = "simple"
28+
}
29+
30+
output "data_proxmox_virtual_environment_sdn_zones_all" {
31+
value = {
32+
zones = data.proxmox_virtual_environment_sdn_zones.all.zones
33+
}
34+
}
35+
36+
output "data_proxmox_virtual_environment_sdn_zones_filtered" {
37+
value = {
38+
evpn_zones = data.proxmox_virtual_environment_sdn_zones.evpn_only.zones
39+
simple_zones = data.proxmox_virtual_environment_sdn_zones.simple_only.zones
40+
}
41+
}
42+
```
43+
44+
<!-- schema generated by tfplugindocs -->
45+
## Schema
46+
47+
### Optional
48+
49+
- `type` (String) Filter zones by type (simple, vlan, qinq, vxlan, evpn).
50+
51+
### Read-Only
52+
53+
- `zones` (List of Object) List of SDN zones. (see [below for nested schema](#nestedatt--zones))
54+
55+
<a id="nestedatt--zones"></a>
56+
### Nested Schema for `zones`
57+
58+
Read-Only:
59+
60+
- `advertise_subnets` (Boolean)
61+
- `bridge` (String)
62+
- `controller` (String)
63+
- `disable_arp_nd_suppression` (Boolean)
64+
- `dns` (String)
65+
- `dns_zone` (String)
66+
- `exit_nodes` (Set of String)
67+
- `exit_nodes_local_routing` (Boolean)
68+
- `id` (String)
69+
- `ipam` (String)
70+
- `mtu` (Number)
71+
- `nodes` (Set of String)
72+
- `peers` (Set of String)
73+
- `primary_exit_node` (String)
74+
- `reverse_dns` (String)
75+
- `rt_import` (String)
76+
- `service_vlan` (Number)
77+
- `service_vlan_protocol` (String)
78+
- `type` (String)
79+
- `vrf_vxlan` (Number)

0 commit comments

Comments
 (0)