Skip to content

Conversation

bpg
Copy link
Owner

@bpg bpg commented Jul 18, 2025

Based on #1995

This PR introduces comprehensive Software Defined Networking (SDN) zones support to the Terraform provider, enabling users to manage various types of SDN zones in Proxmox VE.

🚀 Resources Added

SDN Zone Resources

  • proxmox_virtual_environment_sdn_zone_simple - Simple isolated VNet bridge for local VM traffic
  • proxmox_virtual_environment_sdn_zone_vlan - VLAN-based zones with bridge configuration
  • proxmox_virtual_environment_sdn_zone_qinq - QinQ (802.1ad) zones with service VLAN support
  • proxmox_virtual_environment_sdn_zone_vxlan - VXLAN zones with peer configuration
  • proxmox_virtual_environment_sdn_zone_evpn - EVPN zones with controller and exit node support

📊 Data Sources Added

Individual Zone Data Sources

  • proxmox_virtual_environment_sdn_zone_simple - Retrieve specific Simple zone configuration
  • proxmox_virtual_environment_sdn_zone_vlan - Retrieve specific VLAN zone configuration
  • proxmox_virtual_environment_sdn_zone_qinq - Retrieve specific QinQ zone configuration
  • proxmox_virtual_environment_sdn_zone_vxlan - Retrieve specific VXLAN zone configuration
  • proxmox_virtual_environment_sdn_zone_evpn - Retrieve specific EVPN zone configuration

Zone Listing Data Source

  • proxmox_virtual_environment_sdn_zones - List all SDN zones with optional type filtering

📝 Usage Examples

Creating SDN Zones

Simple Zone

resource "proxmox_virtual_environment_sdn_zone_simple" "example" {
  id    = "simple1"
  nodes = ["pve"]
  mtu   = 1500

  # Optional attributes
  dns         = "1.1.1.1"
  dns_zone    = "example.com"
  ipam        = "pve"
  reverse_dns = "1.1.1.1"
}

VLAN Zone

resource "proxmox_virtual_environment_sdn_zone_vlan" "example" {
  id     = "vlan1"
  nodes  = ["pve"]
  bridge = "vmbr0"
  mtu    = 1500

  # Optional attributes
  dns         = "1.1.1.1"
  dns_zone    = "example.com"
  ipam        = "pve"
  reverse_dns = "1.1.1.1"
}

QinQ Zone

resource "proxmox_virtual_environment_sdn_zone_qinq" "example" {
  id                    = "qinq1"
  nodes                 = ["pve"]
  bridge                = "vmbr0"
  service_vlan          = 100
  service_vlan_protocol = "802.1ad"
  mtu                   = 1496

  # Optional attributes
  dns         = "1.1.1.1"
  dns_zone    = "example.com"
  ipam        = "pve"
  reverse_dns = "1.1.1.1"
}

VXLAN Zone

resource "proxmox_virtual_environment_sdn_zone_vxlan" "example" {
  id    = "vxlan1"
  nodes = ["pve"]
  peers = ["10.0.0.1", "10.0.0.2", "10.0.0.3"]
  mtu   = 1450

  # Optional attributes
  dns         = "1.1.1.1"
  dns_zone    = "example.com"
  ipam        = "pve"
  reverse_dns = "1.1.1.1"
}

EVPN Zone

resource "proxmox_virtual_environment_sdn_zone_evpn" "example" {
  id         = "evpn1"
  nodes      = ["pve"]
  controller = "evpn-controller1"
  vrf_vxlan  = 4000

  # Optional attributes
  advertise_subnets          = true
  disable_arp_nd_suppression = false
  exit_nodes                 = ["pve-exit1", "pve-exit2"]
  exit_nodes_local_routing   = true
  primary_exit_node          = "pve-exit1"
  rt_import                  = "65000:65000"
  mtu                        = 1450

  # Generic optional attributes
  dns         = "1.1.1.1"
  dns_zone    = "example.com"
  ipam        = "pve"
  reverse_dns = "1.1.1.1"
}

Querying SDN Zones

Individual Zone Data Source

data "proxmox_virtual_environment_sdn_zone_evpn" "example" {
  id = "evpn1"
}

output "evpn_zone_info" {
  value = {
    id                         = data.proxmox_virtual_environment_sdn_zone_evpn.example.id
    nodes                      = data.proxmox_virtual_environment_sdn_zone_evpn.example.nodes
    controller                 = data.proxmox_virtual_environment_sdn_zone_evpn.example.controller
    vrf_vxlan                  = data.proxmox_virtual_environment_sdn_zone_evpn.example.vrf_vxlan
    advertise_subnets          = data.proxmox_virtual_environment_sdn_zone_evpn.example.advertise_subnets
    exit_nodes                 = data.proxmox_virtual_environment_sdn_zone_evpn.example.exit_nodes
    # ... other attributes
  }
}

List All Zones

# List all SDN zones
data "proxmox_virtual_environment_sdn_zones" "all" {}

# List only EVPN zones
data "proxmox_virtual_environment_sdn_zones" "evpn_only" {
  type = "evpn"
}

# List only Simple zones  
data "proxmox_virtual_environment_sdn_zones" "simple_only" {
  type = "simple"
}

output "all_zones" {
  value = {
    zones = data.proxmox_virtual_environment_sdn_zones.all.zones
  }
}

output "filtered_zones" {
  value = {
    evpn_zones   = data.proxmox_virtual_environment_sdn_zones.evpn_only.zones
    simple_zones = data.proxmox_virtual_environment_sdn_zones.simple_only.zones
  }
}

✨ Key Features

  • Full CRUD Operations: Create, read, update, and delete SDN zones
  • Zone Type Support: All major SDN zone types (Simple, VLAN, QinQ, VXLAN, EVPN)
  • Comprehensive Configuration: Support for all zone-specific attributes
  • Filtering Capability: List data source supports filtering by zone type
  • Import Support: All resources support Terraform import functionality
  • Type-Safe Implementation: Uses Terraform Plugin Framework for robust type safety

🔧 Implementation Details

This implementation provides complete SDN zone management capabilities, enabling users to build sophisticated software-defined networking configurations in their Proxmox VE infrastructure. All resources follow Terraform best practices and include comprehensive test coverage.

📚 Documentation

Complete documentation and examples are included for all new resources and data sources in the docs/ and examples/ directories.

Contributor's Note

  • I have added / updated documentation in /docs for any user-facing features or additions.
  • I have added / updated acceptance tests in /fwprovider/tests for any new or updated resources / data sources.
  • I have ran make example to verify that the change works as expected.

Note: no updates to legacy tests in /example, acceptance tests cover all that.

Proof of Work

See acceptance tests.

Running tool: /opt/homebrew/bin/go test -timeout 30s -run ^(TestAccResourceSDNZoneSimple|TestAccResourceSDNZoneVLAN|TestAccResourceSDNZoneQinQ|TestAccResourceSDNZoneVXLAN)$ github.com/bpg/terraform-provider-proxmox/fwprovider/cluster/sdn/zone -tags=all

=== RUN   TestAccResourceSDNZoneSimple
=== PAUSE TestAccResourceSDNZoneSimple
=== RUN   TestAccResourceSDNZoneVLAN
=== PAUSE TestAccResourceSDNZoneVLAN
=== RUN   TestAccResourceSDNZoneQinQ
=== PAUSE TestAccResourceSDNZoneQinQ
=== RUN   TestAccResourceSDNZoneVXLAN
=== PAUSE TestAccResourceSDNZoneVXLAN
=== CONT  TestAccResourceSDNZoneSimple
=== CONT  TestAccResourceSDNZoneQinQ
=== RUN   TestAccResourceSDNZoneSimple/create_and_update_zones
=== CONT  TestAccResourceSDNZoneVXLAN
=== PAUSE TestAccResourceSDNZoneSimple/create_and_update_zones
=== CONT  TestAccResourceSDNZoneSimple/create_and_update_zones
=== RUN   TestAccResourceSDNZoneVXLAN/create_and_update_VXLAN_zone
=== PAUSE TestAccResourceSDNZoneVXLAN/create_and_update_VXLAN_zone
=== CONT  TestAccResourceSDNZoneVXLAN/create_and_update_VXLAN_zone
=== CONT  TestAccResourceSDNZoneVLAN
=== RUN   TestAccResourceSDNZoneQinQ/create_and_update_QinQ_zone
=== RUN   TestAccResourceSDNZoneVLAN/create_and_update_VLAN_zone
=== PAUSE TestAccResourceSDNZoneQinQ/create_and_update_QinQ_zone
=== CONT  TestAccResourceSDNZoneQinQ/create_and_update_QinQ_zone
=== PAUSE TestAccResourceSDNZoneVLAN/create_and_update_VLAN_zone
=== CONT  TestAccResourceSDNZoneVLAN/create_and_update_VLAN_zone
--- PASS: TestAccResourceSDNZoneVLAN/create_and_update_VLAN_zone (1.33s)
--- PASS: TestAccResourceSDNZoneVLAN (0.00s)
--- PASS: TestAccResourceSDNZoneQinQ/create_and_update_QinQ_zone (1.33s)
--- PASS: TestAccResourceSDNZoneQinQ (0.00s)
--- PASS: TestAccResourceSDNZoneSimple/create_and_update_zones (2.27s)
--- PASS: TestAccResourceSDNZoneSimple (0.00s)
--- PASS: TestAccResourceSDNZoneVXLAN/create_and_update_VXLAN_zone (3.30s)
--- PASS: TestAccResourceSDNZoneVXLAN (0.00s)
PASS
ok      github.com/bpg/terraform-provider-proxmox/fwprovider/cluster/sdn/zone       3.642s

Running tool: /opt/homebrew/bin/go test -timeout 30s -run ^(TestAccDataSourceSDNZoneSimple|TestAccDataSourceSDNZoneVLAN|TestAccDataSourceSDNZoneQinQ|TestAccDataSourceSDNZoneVXLAN|TestAccDataSourceSDNZones)$ github.com/bpg/terraform-provider-proxmox/fwprovider/cluster/sdn/zone -tags=all

=== RUN   TestAccDataSourceSDNZoneSimple
=== PAUSE TestAccDataSourceSDNZoneSimple
=== RUN   TestAccDataSourceSDNZoneVLAN
=== PAUSE TestAccDataSourceSDNZoneVLAN
=== RUN   TestAccDataSourceSDNZoneQinQ
=== PAUSE TestAccDataSourceSDNZoneQinQ
=== RUN   TestAccDataSourceSDNZoneVXLAN
=== PAUSE TestAccDataSourceSDNZoneVXLAN
=== RUN   TestAccDataSourceSDNZones
=== PAUSE TestAccDataSourceSDNZones
=== CONT  TestAccDataSourceSDNZoneSimple
=== CONT  TestAccDataSourceSDNZoneVXLAN
=== RUN   TestAccDataSourceSDNZoneSimple/create_simple_zone_and_read_with_datasource
=== PAUSE TestAccDataSourceSDNZoneSimple/create_simple_zone_and_read_with_datasource
=== CONT  TestAccDataSourceSDNZoneSimple/create_simple_zone_and_read_with_datasource
=== CONT  TestAccDataSourceSDNZones
=== CONT  TestAccDataSourceSDNZoneVLAN
=== RUN   TestAccDataSourceSDNZoneVXLAN/create_VXLAN_zone_and_read_with_datasource
=== CONT  TestAccDataSourceSDNZoneQinQ
=== PAUSE TestAccDataSourceSDNZoneVXLAN/create_VXLAN_zone_and_read_with_datasource
=== CONT  TestAccDataSourceSDNZoneVXLAN/create_VXLAN_zone_and_read_with_datasource
=== RUN   TestAccDataSourceSDNZones/create_multiple_zones_and_read_with_zones_datasource
=== RUN   TestAccDataSourceSDNZoneVLAN/create_VLAN_zone_and_read_with_datasource
=== PAUSE TestAccDataSourceSDNZones/create_multiple_zones_and_read_with_zones_datasource
=== CONT  TestAccDataSourceSDNZones/create_multiple_zones_and_read_with_zones_datasource
=== PAUSE TestAccDataSourceSDNZoneVLAN/create_VLAN_zone_and_read_with_datasource
=== RUN   TestAccDataSourceSDNZoneQinQ/create_QinQ_zone_and_read_with_datasource
=== PAUSE TestAccDataSourceSDNZoneQinQ/create_QinQ_zone_and_read_with_datasource
=== CONT  TestAccDataSourceSDNZoneQinQ/create_QinQ_zone_and_read_with_datasource
=== CONT  TestAccDataSourceSDNZoneVLAN/create_VLAN_zone_and_read_with_datasource
--- PASS: TestAccDataSourceSDNZoneVLAN/create_VLAN_zone_and_read_with_datasource (1.10s)
--- PASS: TestAccDataSourceSDNZoneVLAN (0.00s)
--- PASS: TestAccDataSourceSDNZoneSimple/create_simple_zone_and_read_with_datasource (1.13s)
--- PASS: TestAccDataSourceSDNZoneSimple (0.00s)
--- PASS: TestAccDataSourceSDNZoneQinQ/create_QinQ_zone_and_read_with_datasource (1.18s)
--- PASS: TestAccDataSourceSDNZoneQinQ (0.00s)
--- PASS: TestAccDataSourceSDNZoneVXLAN/create_VXLAN_zone_and_read_with_datasource (2.15s)
--- PASS: TestAccDataSourceSDNZoneVXLAN (0.00s)
--- PASS: TestAccDataSourceSDNZones/create_multiple_zones_and_read_with_zones_datasource (2.20s)
--- PASS: TestAccDataSourceSDNZones (0.00s)
PASS
ok      github.com/bpg/terraform-provider-proxmox/fwprovider/cluster/sdn/zone       2.553s

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Relates #817

Summary by CodeRabbit

  • New Features

    • Added support for managing Proxmox SDN zones (Simple, VLAN, QinQ, VXLAN, EVPN) as Terraform resources and data sources.
    • Introduced data sources and resources for querying, creating, updating, and importing SDN zones with comprehensive attribute support.
    • Added ability to filter and list SDN zones by type.
    • Provided extensive documentation and example configurations for all SDN zone types.
  • Documentation

    • Added new documentation pages and usage examples for all SDN zone resources and data sources.
  • Tests

    • Introduced acceptance tests for SDN zone resources and data sources to ensure correct behavior.
  • Chores

    • Updated linter configuration and improved test script flexibility.

Copy link
Contributor

@MacherelR MacherelR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job by splitting the code :)
Only interrogation I have remaining is about class namings but you'll see the comments and let me know what you think !

Happy to collaborate with you

@bpg
Copy link
Owner Author

bpg commented Jul 30, 2025

cursor review

cursor[bot]

This comment was marked as outdated.

@bpg bpg force-pushed the sdn-part1-zones branch from 73c9df1 to 2b20430 Compare July 30, 2025 12:06
@bpg
Copy link
Owner Author

bpg commented Jul 30, 2025

Great job by splitting the code :) Only interrogation I have remaining is about class namings but you'll see the comments and let me know what you think !

Happy to collaborate with you

Thanks for the feedback @MacherelR
Sorry it takes soooo long to get it to the finish line -- summer is a busy time.

coderabbitai[bot]
coderabbitai bot previously approved these changes Jul 30, 2025
bpg added 6 commits July 30, 2025 21:15
Signed-off-by: Pavel Boldyrev <[email protected]>
Signed-off-by: Pavel Boldyrev <[email protected]>
Signed-off-by: Pavel Boldyrev <[email protected]>
Signed-off-by: Pavel Boldyrev <[email protected]>
Signed-off-by: Pavel Boldyrev <[email protected]>
- Updated the genericAttributesWith function to accept a single map of attributes instead of a variadic argument.
- Improved the logic to initialize and merge attributes, ensuring that extra attributes can override the generic ones.
- Adjusted the SimpleResource schema to call genericAttributesWith with nil for clarity.

Signed-off-by: Pavel Boldyrev <[email protected]>
@bpg bpg changed the title SDN part1 zones feat(sdn): add support for zone resources and datasources Jul 31, 2025
@bpg bpg added the automerge label Jul 31, 2025
@bpg bpg force-pushed the sdn-part1-zones branch from 2b20430 to 03203dc Compare July 31, 2025 01:17
coderabbitai[bot]
coderabbitai bot previously approved these changes Jul 31, 2025
Signed-off-by: Pavel Boldyrev <[email protected]>
coderabbitai[bot]
coderabbitai bot previously approved these changes Jul 31, 2025
Signed-off-by: Pavel Boldyrev <[email protected]>
@bpg
Copy link
Owner Author

bpg commented Jul 31, 2025

cursor review

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no bugs!


@bpg bpg marked this pull request as ready for review July 31, 2025 03:05
@bpg
Copy link
Owner Author

bpg commented Jul 31, 2025

@coderabbitai review

Copy link

coderabbitai bot commented Jul 31, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@bpg
Copy link
Owner Author

bpg commented Jul 31, 2025

@coderabbitai full review

Copy link

coderabbitai bot commented Jul 31, 2025

✅ Actions performed

Full review triggered.

@bpg
Copy link
Owner Author

bpg commented Jul 31, 2025

@coderabbitai full review

Copy link

coderabbitai bot commented Jul 31, 2025

✅ Actions performed

Full review triggered.

Copy link

coderabbitai bot commented Jul 31, 2025

Warning

Rate limit exceeded

@coderabbitai[bot] has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 6 minutes and 58 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 757b191 and e86fce1.

📒 Files selected for processing (62)
  • .golangci.yml (1 hunks)
  • docs/data-sources/virtual_environment_sdn_zone_evpn.md (1 hunks)
  • docs/data-sources/virtual_environment_sdn_zone_qinq.md (1 hunks)
  • docs/data-sources/virtual_environment_sdn_zone_simple.md (1 hunks)
  • docs/data-sources/virtual_environment_sdn_zone_vlan.md (1 hunks)
  • docs/data-sources/virtual_environment_sdn_zone_vxlan.md (1 hunks)
  • docs/data-sources/virtual_environment_sdn_zones.md (1 hunks)
  • docs/resources/virtual_environment_sdn_zone_evpn.md (1 hunks)
  • docs/resources/virtual_environment_sdn_zone_qinq.md (1 hunks)
  • docs/resources/virtual_environment_sdn_zone_simple.md (1 hunks)
  • docs/resources/virtual_environment_sdn_zone_vlan.md (1 hunks)
  • docs/resources/virtual_environment_sdn_zone_vxlan.md (1 hunks)
  • examples/data-sources/proxmox_virtual_environment_sdn_zone_evpn/data-source.tf (1 hunks)
  • examples/data-sources/proxmox_virtual_environment_sdn_zone_qinq/data-source.tf (1 hunks)
  • examples/data-sources/proxmox_virtual_environment_sdn_zone_simple/data-source.tf (1 hunks)
  • examples/data-sources/proxmox_virtual_environment_sdn_zone_vlan/data-source.tf (1 hunks)
  • examples/data-sources/proxmox_virtual_environment_sdn_zone_vxlan/data-source.tf (1 hunks)
  • examples/data-sources/proxmox_virtual_environment_sdn_zones/data-source.tf (1 hunks)
  • examples/resources/proxmox_virtual_environment_sdn_zone_evpn/import.sh (1 hunks)
  • examples/resources/proxmox_virtual_environment_sdn_zone_evpn/resource.tf (1 hunks)
  • examples/resources/proxmox_virtual_environment_sdn_zone_qinq/import.sh (1 hunks)
  • examples/resources/proxmox_virtual_environment_sdn_zone_qinq/resource.tf (1 hunks)
  • examples/resources/proxmox_virtual_environment_sdn_zone_simple/import.sh (1 hunks)
  • examples/resources/proxmox_virtual_environment_sdn_zone_simple/resource.tf (1 hunks)
  • examples/resources/proxmox_virtual_environment_sdn_zone_vlan/import.sh (1 hunks)
  • examples/resources/proxmox_virtual_environment_sdn_zone_vlan/resource.tf (1 hunks)
  • examples/resources/proxmox_virtual_environment_sdn_zone_vxlan/import.sh (1 hunks)
  • examples/resources/proxmox_virtual_environment_sdn_zone_vxlan/resource.tf (1 hunks)
  • fwprovider/cluster/sdn/zone/datasource_evpn.go (1 hunks)
  • fwprovider/cluster/sdn/zone/datasource_generic.go (1 hunks)
  • fwprovider/cluster/sdn/zone/datasource_qinq.go (1 hunks)
  • fwprovider/cluster/sdn/zone/datasource_simple.go (1 hunks)
  • fwprovider/cluster/sdn/zone/datasource_vlan.go (1 hunks)
  • fwprovider/cluster/sdn/zone/datasource_vxlan.go (1 hunks)
  • fwprovider/cluster/sdn/zone/datasource_zones.go (1 hunks)
  • fwprovider/cluster/sdn/zone/datasource_zones_test.go (1 hunks)
  • fwprovider/cluster/sdn/zone/resource_evpn.go (1 hunks)
  • fwprovider/cluster/sdn/zone/resource_generic.go (1 hunks)
  • fwprovider/cluster/sdn/zone/resource_qinq.go (1 hunks)
  • fwprovider/cluster/sdn/zone/resource_simple.go (1 hunks)
  • fwprovider/cluster/sdn/zone/resource_vlan.go (1 hunks)
  • fwprovider/cluster/sdn/zone/resource_vxlan.go (1 hunks)
  • fwprovider/cluster/sdn/zone/resource_zones_test.go (1 hunks)
  • fwprovider/nodes/network/resource_linux_bridge.go (0 hunks)
  • fwprovider/nodes/network/resource_linux_vlan.go (0 hunks)
  • fwprovider/provider.go (3 hunks)
  • fwprovider/types/stringset/attribute.go (2 hunks)
  • main.go (2 hunks)
  • proxmox/api/client.go (1 hunks)
  • proxmox/cluster/client.go (2 hunks)
  • proxmox/cluster/sdn/zones/api.go (1 hunks)
  • proxmox/cluster/sdn/zones/client.go (1 hunks)
  • proxmox/cluster/sdn/zones/doc.go (1 hunks)
  • proxmox/cluster/sdn/zones/zones.go (1 hunks)
  • proxmox/cluster/sdn/zones/zones_types.go (1 hunks)
  • proxmox_virtual_environment_sdn_zone_evpn/data-source.tf (1 hunks)
  • proxmox_virtual_environment_sdn_zone_qinq/data-source.tf (1 hunks)
  • proxmox_virtual_environment_sdn_zone_simple/data-source.tf (1 hunks)
  • proxmox_virtual_environment_sdn_zone_vlan/data-source.tf (1 hunks)
  • proxmox_virtual_environment_sdn_zone_vxlan/data-source.tf (1 hunks)
  • proxmox_virtual_environment_sdn_zones/data-source.tf (1 hunks)
  • testacc (1 hunks)
📝 Walkthrough

Walkthrough

This change introduces comprehensive support for Proxmox SDN zones in both the Terraform provider codebase and documentation. It adds new resource and data source implementations for various SDN zone types (simple, VLAN, QinQ, VXLAN, EVPN), corresponding documentation and example files, acceptance tests, and updates to the provider registration. Supporting types, API clients, and utility functions are included, along with minor improvements to linting and test scripts.

Changes

Cohort / File(s) Change Summary
Provider Registration and Integration
fwprovider/provider.go
Registers new SDN zone resources and data sources in the provider for all supported types.
Generic SDN Zone Resource/Data Source Framework
fwprovider/cluster/sdn/zone/datasource_generic.go, fwprovider/cluster/sdn/zone/resource_generic.go
Introduces generic resource and data source implementations for SDN zones, enabling code reuse and extension for specific zone types.
Simple SDN Zone Implementation
fwprovider/cluster/sdn/zone/datasource_simple.go, fwprovider/cluster/sdn/zone/resource_simple.go
Adds resource and data source for Simple SDN zones, with schema, CRUD, and import logic.
VLAN SDN Zone Implementation
fwprovider/cluster/sdn/zone/datasource_vlan.go, fwprovider/cluster/sdn/zone/resource_vlan.go
Adds resource and data source for VLAN SDN zones, including bridge attribute and full lifecycle support.
QinQ SDN Zone Implementation
fwprovider/cluster/sdn/zone/datasource_qinq.go, fwprovider/cluster/sdn/zone/resource_qinq.go
Adds resource and data source for QinQ SDN zones, handling service VLAN and protocol attributes.
VXLAN SDN Zone Implementation
fwprovider/cluster/sdn/zone/datasource_vxlan.go, fwprovider/cluster/sdn/zone/resource_vxlan.go
Adds resource and data source for VXLAN SDN zones, supporting peers attribute and overlay tunnel logic.
EVPN SDN Zone Implementation
fwprovider/cluster/sdn/zone/datasource_evpn.go, fwprovider/cluster/sdn/zone/resource_evpn.go
Adds resource and data source for EVPN SDN zones, supporting advanced attributes like controller, exit nodes, and VRF VXLAN.
SDN Zones Collection Data Source
fwprovider/cluster/sdn/zone/datasource_zones.go
Implements a data source for listing all SDN zones, with optional filtering by type.
Acceptance Tests for SDN Zones
fwprovider/cluster/sdn/zone/datasource_zones_test.go, fwprovider/cluster/sdn/zone/resource_zones_test.go
Provides acceptance tests for all SDN zone resources and data sources, covering creation, update, read, and import scenarios.
Proxmox SDN Zones API Client and Types
proxmox/cluster/sdn/zones/api.go, proxmox/cluster/sdn/zones/client.go, proxmox/cluster/sdn/zones/doc.go, proxmox/cluster/sdn/zones/zones.go, proxmox/cluster/sdn/zones/zones_types.go, proxmox/cluster/client.go
Introduces client, types, and API interface for SDN zones, enabling CRUD operations and integration with the provider.
String Set Attribute Utility
fwprovider/types/stringset/attribute.go
Enhances string set schema attribute utility with functional options for required/optional/computed configuration.
Documentation: Data Sources
docs/data-sources/virtual_environment_sdn_zone_evpn.md, docs/data-sources/virtual_environment_sdn_zone_qinq.md, docs/data-sources/virtual_environment_sdn_zone_simple.md, docs/data-sources/virtual_environment_sdn_zone_vlan.md, docs/data-sources/virtual_environment_sdn_zone_vxlan.md, docs/data-sources/virtual_environment_sdn_zones.md
Adds detailed documentation for all SDN zone data sources, including usage, schema, and examples.
Documentation: Resources
docs/resources/virtual_environment_sdn_zone_evpn.md, docs/resources/virtual_environment_sdn_zone_qinq.md, docs/resources/virtual_environment_sdn_zone_simple.md, docs/resources/virtual_environment_sdn_zone_vlan.md, docs/resources/virtual_environment_sdn_zone_vxlan.md
Adds documentation for all SDN zone resources, covering attributes, examples, and import instructions.
Examples: Data Sources
examples/data-sources/proxmox_virtual_environment_sdn_zone_evpn/data-source.tf, examples/data-sources/proxmox_virtual_environment_sdn_zone_qinq/data-source.tf, examples/data-sources/proxmox_virtual_environment_sdn_zone_simple/data-source.tf, examples/data-sources/proxmox_virtual_environment_sdn_zone_vlan/data-source.tf, examples/data-sources/proxmox_virtual_environment_sdn_zone_vxlan/data-source.tf, examples/data-sources/proxmox_virtual_environment_sdn_zones/data-source.tf, proxmox_virtual_environment_sdn_zone_evpn/data-source.tf, proxmox_virtual_environment_sdn_zone_qinq/data-source.tf, proxmox_virtual_environment_sdn_zone_simple/data-source.tf, proxmox_virtual_environment_sdn_zone_vlan/data-source.tf, proxmox_virtual_environment_sdn_zone_vxlan/data-source.tf, proxmox_virtual_environment_sdn_zones/data-source.tf
Adds example Terraform configurations for each SDN zone data source and for querying all/filtered zones.
Examples: Resources and Import Scripts
examples/resources/proxmox_virtual_environment_sdn_zone_evpn/resource.tf, examples/resources/proxmox_virtual_environment_sdn_zone_evpn/import.sh, examples/resources/proxmox_virtual_environment_sdn_zone_qinq/resource.tf, examples/resources/proxmox_virtual_environment_sdn_zone_qinq/import.sh, examples/resources/proxmox_virtual_environment_sdn_zone_simple/resource.tf, examples/resources/proxmox_virtual_environment_sdn_zone_simple/import.sh, examples/resources/proxmox_virtual_environment_sdn_zone_vlan/resource.tf, examples/resources/proxmox_virtual_environment_sdn_zone_vlan/import.sh, examples/resources/proxmox_virtual_environment_sdn_zone_vxlan/resource.tf, examples/resources/proxmox_virtual_environment_sdn_zone_vxlan/import.sh
Adds example resource configurations and import scripts for all SDN zone types.
Linting and Build/Docs Integration
.golangci.yml, main.go
Adds linter configuration for line length and updates go:generate/build steps to include new SDN zone documentation.
Minor Code Improvements
fwprovider/nodes/network/resource_linux_bridge.go, fwprovider/nodes/network/resource_linux_vlan.go, proxmox/api/client.go
Removes unnecessary nolint directives and improves error message formatting.
Test Script Enhancement
testacc
Updates acceptance test script to dynamically determine Go package path based on test function name for targeted testing.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45-60 minutes

Suggested labels

autoapprove, size/XL, Review effort [1-5]: 4


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

coderabbitai bot commented Jul 31, 2025

✅ Actions performed

Full review triggered.

@coderabbitai coderabbitai bot added the size/XL label Jul 31, 2025
@coderabbitai coderabbitai bot added the size/XL label Jul 31, 2025
@coderabbitai coderabbitai bot added the size/XL label Jul 31, 2025
@bpg bpg merged commit 6b73d82 into main Aug 1, 2025
9 checks passed
@bpg bpg deleted the sdn-part1-zones branch August 1, 2025 00:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants