Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions example/data_source_virtual_environment_sdn.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
data "proxmox_virtual_environment_sdn_zone_simple" "test_zone_1" {
depends_on = [proxmox_virtual_environment_sdn_zone_simple.test_zone_1]
id = proxmox_virtual_environment_sdn_zone_simple.test_zone_1.id
}

data "proxmox_virtual_environment_sdn_zones" "simple" {
depends_on = [
proxmox_virtual_environment_sdn_zone_simple.test_zone_1,
proxmox_virtual_environment_sdn_zone_simple.test_zone_2,
]
type = "simple"
}

data "proxmox_virtual_environment_sdn_zones" "all" {
depends_on = [
proxmox_virtual_environment_sdn_zone_simple.test_zone_1,
proxmox_virtual_environment_sdn_zone_simple.test_zone_2,
]
}

data "proxmox_virtual_environment_sdn_vnet" "test_vnet_1" {
depends_on = [proxmox_virtual_environment_sdn_vnet.test_vnet_1]
id = proxmox_virtual_environment_sdn_vnet.test_vnet_1.id
}

data "proxmox_virtual_environment_sdn_subnet" "test_subnet_dhcp" {
depends_on = [proxmox_virtual_environment_sdn_subnet.test_subnet_dhcp]
cidr = proxmox_virtual_environment_sdn_subnet.test_subnet_dhcp.cidr
vnet = proxmox_virtual_environment_sdn_vnet.test_vnet_1.id
}

output "proxmox_virtual_environment_sdn_zone_simple" {
value = data.proxmox_virtual_environment_sdn_zone_simple.test_zone_1
}

output "proxmox_virtual_environment_sdn_zones_simple" {
value = data.proxmox_virtual_environment_sdn_zones.simple.zones
}

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

output "proxmox_virtual_environment_sdn_vnet" {
value = data.proxmox_virtual_environment_sdn_vnet.test_vnet_1
}

output "proxmox_virtual_environment_sdn_subnet" {
value = data.proxmox_virtual_environment_sdn_subnet.test_subnet_dhcp
}
4 changes: 4 additions & 0 deletions fwprovider/cluster/sdn/subnet/datasource.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ func (d *DataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp
},
"dhcp_dns_server": schema.StringAttribute{
Description: "The DNS server used for DHCP.",
CustomType: customtypes.IPAddrType{},
Computed: true,
},
"dhcp_range": schema.SingleNestedAttribute{
Expand All @@ -82,10 +83,12 @@ func (d *DataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp
Computed: true,
Attributes: map[string]schema.Attribute{
"start_address": schema.StringAttribute{
CustomType: customtypes.IPAddrType{},
Computed: true,
Description: "Start of the DHCP range.",
},
"end_address": schema.StringAttribute{
CustomType: customtypes.IPAddrType{},
Computed: true,
Description: "End of the DHCP range.",
},
Expand All @@ -97,6 +100,7 @@ func (d *DataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp
},
"gateway": schema.StringAttribute{
Description: "The gateway address for the subnet.",
CustomType: customtypes.IPAddrType{},
Computed: true,
},
"snat": schema.BoolAttribute{
Expand Down