From d98513abe91b36b75652ec13ab4ea2d3d53ad8d1 Mon Sep 17 00:00:00 2001 From: James Toyer Date: Thu, 18 Feb 2021 21:54:58 +0000 Subject: [PATCH] Fix up docs examples --- docs/data-sources/port_profile.md | 32 +++++++++++++++++++++++++++++++ docs/resources/port_profile.md | 24 +++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 docs/data-sources/port_profile.md diff --git a/docs/data-sources/port_profile.md b/docs/data-sources/port_profile.md new file mode 100644 index 0000000..8247d9f --- /dev/null +++ b/docs/data-sources/port_profile.md @@ -0,0 +1,32 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "unifi_port_profile Data Source - terraform-provider-unifi" +subcategory: "" +description: |- + unifi_port_profile data source can be used to retrieve the ID for a port profile by name. +--- + +# Data Source `unifi_port_profile` + +`unifi_port_profile` data source can be used to retrieve the ID for a port profile by name. + +## Example Usage + +```terraform +data "unifi_port_profile" "all" { +} +``` + + +## Schema + +### Optional + +- **name** (String) The name of the port profile to look up. Defaults to `All`. +- **site** (String) The name of the site the port profile is associated with. + +### Read-only + +- **id** (String) The ID of this port profile. + + diff --git a/docs/resources/port_profile.md b/docs/resources/port_profile.md index 35b2b97..5bee3b2 100644 --- a/docs/resources/port_profile.md +++ b/docs/resources/port_profile.md @@ -10,7 +10,31 @@ description: |- `unifi_port_profile` manages a port profile for use on network switches. +## Example Usage +```terraform +variable "vlan_id" { + default = 10 +} + +resource "unifi_network" "vlan" { + name = "wifi-vlan" + purpose = "corporate" + + subnet = "10.0.0.1/24" + vlan_id = var.vlan_id + dhcp_start = "10.0.0.6" + dhcp_stop = "10.0.0.254" + dhcp_enabled = true +} + +resource "unifi_port_profile" "poe_disabled" { + name = "POE Disabled" + + native_networkconf_id = unifi_network.vlan.id + poe_mode = "off" +} +``` ## Schema