From 1f968b44bdf453a76b0728aa9798229a22fd217e Mon Sep 17 00:00:00 2001 From: bwJuniper <98770420+bwJuniper@users.noreply.github.com> Date: Wed, 15 Nov 2023 14:34:15 -0800 Subject: [PATCH] add virtual_network to provider.go and make docs --- apstra/provider.go | 1 + .../datacenter_virtual_network.md | 62 +++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 docs/data-sources/datacenter_virtual_network.md diff --git a/apstra/provider.go b/apstra/provider.go index a46b11b7..095e3f98 100644 --- a/apstra/provider.go +++ b/apstra/provider.go @@ -433,6 +433,7 @@ func (p *Provider) DataSources(_ context.Context) []func() datasource.DataSource func() datasource.DataSource { return &dataSourceDatacenterSystemNode{} }, func() datasource.DataSource { return &dataSourceDatacenterSystemNodes{} }, func() datasource.DataSource { return &dataSourceDatacenterSvis{} }, + func() datasource.DataSource { return &dataSourceDatacenterVirtualNetwork{} }, func() datasource.DataSource { return &dataSourceDatacenterVirtualNetworks{} }, func() datasource.DataSource { return &dataSourceBlueprintIbaPredefinedProbe{} }, func() datasource.DataSource { return &dataSourceBlueprintIbaWidget{} }, diff --git a/docs/data-sources/datacenter_virtual_network.md b/docs/data-sources/datacenter_virtual_network.md new file mode 100644 index 00000000..908f790d --- /dev/null +++ b/docs/data-sources/datacenter_virtual_network.md @@ -0,0 +1,62 @@ +--- +page_title: "apstra_datacenter_virtual_network Data Source - terraform-provider-apstra" +subcategory: "Reference Design: Datacenter" +description: |- + This resource returns details of a Virtual Network within a Datacenter Blueprint. + At least one optional attribute is required. +--- + +# apstra_datacenter_virtual_network (Data Source) + +This resource returns details of a Virtual Network within a Datacenter Blueprint. + +At least one optional attribute is required. + + +## Example Usage + +```terraform +# Returns the data Attributes associated with the specified Virtual Network +# id +data "apstra_datacenter_virtual_network" "vnet_blue" { + blueprint_id = "b726704d-f80e-4733-9103-abd6ccd8752c" + name = "vnet_b" +} + +locals { + vnet_b_id = data.apstra_datacenter_virtual_network.vnet_blue.id +} +``` + + +## Schema + +### Required + +- `blueprint_id` (String) The blueprint ID where the Virtual Network is present. + +### Optional + +- `id` (String) The id of the Virtual Network +- `name` (String) Virtual Network Name + +### Read-Only + +- `bindings` (Attributes Map) Details availability of the virtual network on leaf and access switches (see [below for nested schema](#nestedatt--bindings)) +- `dhcp_service_enabled` (Boolean) Enables a DHCP relay agent. +- `had_prior_vni_config` (Boolean) Not applicable in data source context. Ignore. +- `ipv4_connectivity_enabled` (Boolean) Enables IPv4 within the Virtual Network. +- `ipv4_subnet` (String) IPv4 subnet associated with the Virtual Network. +- `ipv4_virtual_gateway` (String) Specifies the IPv4 virtual gateway address within the Virtual Network. +- `ipv4_virtual_gateway_enabled` (Boolean) Controls and indicates whether the IPv4 gateway within the Virtual Network is enabled. +- `ipv6_connectivity_enabled` (Boolean) Enables IPv6 within the Virtual Network. +- `ipv6_subnet` (String) IPv6 subnet associated with the Virtual Network. Note that this attribute will not appear in the `graph_query` output because IPv6 zero compression rules are problematic for mechanisms which rely on string matching. +- `ipv6_virtual_gateway` (String) Specifies the IPv6 virtual gateway address within the Virtual Network. Note that this attribute will not appear in the `graph_query` output because IPv6 zero compression rules are problematic for mechanisms which rely on string matching. +- `ipv6_virtual_gateway_enabled` (Boolean) Controls and indicates whether the IPv6 gateway within the Virtual Network is enabled. +- `reserve_vlan` (Boolean) For use only with `vxlan` type Virtual networks when all `bindings` use the same VLAN ID. This option reserves the VLAN fabric-wide, even on switches to which the Virtual Network has not yet been deployed. +- `routing_zone_id` (String) Routing Zone ID (only applies when `type == vxlan` +- `type` (String) Virtual Network Type +- `vni` (Number) EVPN Virtual Network ID to be associated with this Virtual Network. + + +### Nested Schema for `bindings`