Skip to content

Commit e13d7ef

Browse files
MacherelRbpggemini-code-assist[bot]
authored
feat(sdn): added custom resource to apply sdn configurations (#2127)
* feat(sdn): added custom resource to apply sdn configurations * fix(sdn): proper handling of pending state --------- Signed-off-by: MacherelR <[email protected]> Signed-off-by: Pavel Boldyrev <[email protected]> Co-authored-by: Pavel Boldyrev <[email protected]> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent f62e69d commit e13d7ef

35 files changed

+1103
-34
lines changed

docs/data-sources/virtual_environment_sdn_zone_evpn.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ output "data_proxmox_virtual_environment_sdn_zone_evpn" {
5858
- `ipam` (String) IP Address Management system.
5959
- `mtu` (Number) MTU value for the zone.
6060
- `nodes` (Set of String) The Proxmox nodes which the zone and associated VNets are deployed on
61+
- `pending` (Boolean) Indicates if the zone has pending configuration changes that need to be applied.
6162
- `primary_exit_node` (String) Primary exit node for EVPN.
6263
- `reverse_dns` (String) Reverse DNS API server address.
6364
- `rt_import` (String) Route target import for EVPN. Must be in the format '<ASN>:<number>' (e.g., '65000:65000').
65+
- `state` (String) Indicates the current state of the zone.
6466
- `vrf_vxlan` (Number) VRF VXLAN-ID used for dedicated routing interconnect between VNets. It must be different than the VXLAN-ID of the VNets.

docs/data-sources/virtual_environment_sdn_zone_qinq.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ output "data_proxmox_virtual_environment_sdn_zone_qinq" {
4949
- `ipam` (String) IP Address Management system.
5050
- `mtu` (Number) MTU value for the zone.
5151
- `nodes` (Set of String) The Proxmox nodes which the zone and associated VNets are deployed on
52+
- `pending` (Boolean) Indicates if the zone has pending configuration changes that need to be applied.
5253
- `reverse_dns` (String) Reverse DNS API server address.
5354
- `service_vlan` (Number) Service VLAN tag for QinQ. The tag must be between `1` and `4094`.
5455
- `service_vlan_protocol` (String) Service VLAN protocol for QinQ. The protocol must be `802.1ad` or `802.1q`.
56+
- `state` (String) Indicates the current state of the zone.

docs/data-sources/virtual_environment_sdn_zone_simple.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,6 @@ output "data_proxmox_virtual_environment_sdn_zone_simple" {
4545
- `ipam` (String) IP Address Management system.
4646
- `mtu` (Number) MTU value for the zone.
4747
- `nodes` (Set of String) The Proxmox nodes which the zone and associated VNets are deployed on
48+
- `pending` (Boolean) Indicates if the zone has pending configuration changes that need to be applied.
4849
- `reverse_dns` (String) Reverse DNS API server address.
50+
- `state` (String) Indicates the current state of the zone.

docs/data-sources/virtual_environment_sdn_zone_vlan.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,6 @@ output "data_proxmox_virtual_environment_sdn_zone_vlan" {
4747
- `ipam` (String) IP Address Management system.
4848
- `mtu` (Number) MTU value for the zone.
4949
- `nodes` (Set of String) The Proxmox nodes which the zone and associated VNets are deployed on
50+
- `pending` (Boolean) Indicates if the zone has pending configuration changes that need to be applied.
5051
- `reverse_dns` (String) Reverse DNS API server address.
52+
- `state` (String) Indicates the current state of the zone.

docs/data-sources/virtual_environment_sdn_zone_vxlan.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,6 @@ output "data_proxmox_virtual_environment_sdn_zone_vxlan" {
4747
- `mtu` (Number) MTU value for the zone.
4848
- `nodes` (Set of String) The Proxmox nodes which the zone and associated VNets are deployed on
4949
- `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+
- `pending` (Boolean) Indicates if the zone has pending configuration changes that need to be applied.
5051
- `reverse_dns` (String) Reverse DNS API server address.
52+
- `state` (String) Indicates the current state of the zone.

docs/data-sources/virtual_environment_sdn_zones.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,12 @@ Read-Only:
7070
- `mtu` (Number)
7171
- `nodes` (Set of String)
7272
- `peers` (Set of String)
73+
- `pending` (Boolean)
7374
- `primary_exit_node` (String)
7475
- `reverse_dns` (String)
7576
- `rt_import` (String)
7677
- `service_vlan` (Number)
7778
- `service_vlan_protocol` (String)
79+
- `state` (String)
7880
- `type` (String)
7981
- `vrf_vxlan` (Number)
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
layout: page
3+
title: proxmox_virtual_environment_sdn_applier
4+
parent: Resources
5+
subcategory: Virtual Environment
6+
description: |-
7+
EXPERIMENTAL Triggers Proxmox's SDN Apply (equivalent to PUT /cluster/sdn).Intended to be used with replace_triggered_by so it runs after SDN objects change.
8+
---
9+
10+
# Resource: proxmox_virtual_environment_sdn_applier
11+
12+
**EXPERIMENTAL** Triggers Proxmox's SDN **Apply** (equivalent to `PUT /cluster/sdn`).Intended to be used with `replace_triggered_by` so it runs after SDN objects change.
13+
14+
## Example Usage
15+
16+
```terraform
17+
resource "proxmox_virtual_environment_sdn_zone_simple" "test_zone_1" {
18+
id = "tZone1"
19+
nodes = [data.proxmox_virtual_environment_nodes.example.names]
20+
mtu = 1496
21+
22+
depends_on = [
23+
proxmox_virtual_environment_sdn_applier.finalizer
24+
]
25+
}
26+
27+
resource "proxmox_virtual_environment_sdn_zone_simple" "test_zone_2" {
28+
id = "tZone2"
29+
nodes = [data.proxmox_virtual_environment_nodes.example.names]
30+
mtu = 1496
31+
32+
depends_on = [
33+
proxmox_virtual_environment_sdn_applier.finalizer
34+
]
35+
}
36+
37+
resource "proxmox_virtual_environment_sdn_applier" "applier" {
38+
lifecycle {
39+
replace_triggered_by = [
40+
proxmox_virtual_environment_sdn_zone_simple.test_zone_1,
41+
proxmox_virtual_environment_sdn_zone_simple.test_zone_2,
42+
]
43+
}
44+
45+
depends_on = [
46+
proxmox_virtual_environment_sdn_zone_simple.test_zone_1,
47+
proxmox_virtual_environment_sdn_zone_simple.test_zone_2,
48+
]
49+
}
50+
51+
resource "proxmox_virtual_environment_sdn_applier" "finalizer" {
52+
}
53+
```
54+
55+
<!-- schema generated by tfplugindocs -->
56+
## Schema
57+
58+
### Read-Only
59+
60+
- `id` (String) Opaque identifier set to the Unix timestamp (milliseconds) when the apply was executed.

docs/resources/virtual_environment_sdn_zone_evpn.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ resource "proxmox_virtual_environment_sdn_zone_evpn" "example" {
6161
- `reverse_dns` (String) Reverse DNS API server address.
6262
- `rt_import` (String) Route target import for EVPN.
6363

64+
### Read-Only
65+
66+
- `pending` (Boolean) Indicates if the zone has pending configuration changes that need to be applied.
67+
- `state` (String) Indicates the current state of the zone.
68+
6469
## Import
6570

6671
Import is supported using the following syntax:

docs/resources/virtual_environment_sdn_zone_qinq.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ resource "proxmox_virtual_environment_sdn_zone_qinq" "example" {
4949
- `reverse_dns` (String) Reverse DNS API server address.
5050
- `service_vlan_protocol` (String) Service VLAN protocol for QinQ. The protocol must be `802.1ad` or `802.1q`.
5151

52+
### Read-Only
53+
54+
- `pending` (Boolean) Indicates if the zone has pending configuration changes that need to be applied.
55+
- `state` (String) Indicates the current state of the zone.
56+
5257
## Import
5358

5459
Import is supported using the following syntax:

docs/resources/virtual_environment_sdn_zone_simple.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ resource "proxmox_virtual_environment_sdn_zone_simple" "example" {
4343
- `mtu` (Number) MTU value for the zone.
4444
- `reverse_dns` (String) Reverse DNS API server address.
4545

46+
### Read-Only
47+
48+
- `pending` (Boolean) Indicates if the zone has pending configuration changes that need to be applied.
49+
- `state` (String) Indicates the current state of the zone.
50+
4651
## Import
4752

4853
Import is supported using the following syntax:

0 commit comments

Comments
 (0)