Docs updates, more examples, some tool updates

Change docs dirs based on registry expectations
This commit is contained in:
Paul Tyng
2020-06-29 21:45:34 -04:00
parent bb6ad086d4
commit 46709ebf37
23 changed files with 87 additions and 56 deletions

View File

@@ -0,0 +1,10 @@
variable "laptop_ips" {
type = list(string)
}
resource "unifi_firewall_group" "can_print" {
name = "can-print"
type = "address-group"
members = var.laptop_ips
}

View File

@@ -0,0 +1,15 @@
variable "ip_address" {
type = string
}
resource "unifi_firewall_rule" "drop_all" {
name = "drop all"
action = "drop"
ruleset = "LAN_IN"
rule_index = 2011
protocol = "all"
dst_address = var.ip_address
}

View File

@@ -9,9 +9,7 @@ import (
func dataRADIUSProfile() *schema.Resource {
return &schema.Resource{
Description: `
unifi_radius_profile data source can be used to retrieve the ID for a RADIUS profile by name.
`,
Description: "`unifi_radius_profile` data source can be used to retrieve the ID for a RADIUS profile by name.",
Read: dataRADIUSProfileRead,

View File

@@ -9,9 +9,7 @@ import (
func dataUserGroup() *schema.Resource {
return &schema.Resource{
Description: `
unifi_user_group data source can be used to retrieve the ID for a user group by name.
`,
Description: "`unifi_user_group` data source can be used to retrieve the ID for a user group by name.",
Read: dataUserGroupRead,

View File

@@ -9,9 +9,7 @@ import (
func dataWLANGroup() *schema.Resource {
return &schema.Resource{
Description: `
unifi_wlan_group data source can be used to retrieve the ID for a WLAN group by name.
`,
Description: "`unifi_wlan_group` data source can be used to retrieve the ID for a WLAN group by name.",
Read: dataWLANGroupRead,

View File

@@ -10,9 +10,8 @@ import (
func resourceFirewallGroup() *schema.Resource {
return &schema.Resource{
Description: `
unifi_firewall_group manages groups of addresses or ports for use in firewall rules (unifi_firewall_rule).
`,
Description: "`unifi_firewall_group` manages groups of addresses or ports for use in firewall rules (`unifi_firewall_rule`).",
Create: resourceFirewallGroupCreate,
Read: resourceFirewallGroupRead,
Update: resourceFirewallGroupUpdate,

View File

@@ -13,9 +13,8 @@ var firewallRuleProtocolRegexp = regexp.MustCompile("^$|all|([0-9]|[1-9][0-9]|1[
func resourceFirewallRule() *schema.Resource {
return &schema.Resource{
Description: `
unifi_firewall_rule manages an individual firewall rule on the gateway.
`,
Description: "`unifi_firewall_rule` manages an individual firewall rule on the gateway.",
Create: resourceFirewallRuleCreate,
Read: resourceFirewallRuleRead,
Update: resourceFirewallRuleUpdate,

View File

@@ -11,9 +11,7 @@ import (
func resourceNetwork() *schema.Resource {
return &schema.Resource{
Description: `
unifi_network manages LAN/VLAN networks.
`,
Description: "`unifi_network` manages LAN/VLAN networks.",
Create: resourceNetworkCreate,
Read: resourceNetworkRead,

View File

@@ -10,9 +10,7 @@ import (
func resourcePortForward() *schema.Resource {
return &schema.Resource{
Description: `
unifi_port_forward manages a port forwarding rule on the gateway.
`,
Description: "`unifi_port_forward` manages a port forwarding rule on the gateway.",
Create: resourcePortForwardCreate,
Read: resourcePortForwardRead,

View File

@@ -10,13 +10,10 @@ import (
func resourceUser() *schema.Resource {
return &schema.Resource{
Description: `
unifi_user manages a user (or "client" in the UI) of the network, these are identified
by unique MAC addresses.
Users are "created" in the controller when observed on the network, so the resource defaults to allowing
itself to just take over management of a MAC address, but this can be turned off.
`,
Description: "`unifi_user` manages a user (or \"client\" in the UI) of the network, these are identified " +
"by unique MAC addresses.\n\n" +
"Users are created in the controller when observed on the network, so the resource defaults to allowing " +
"itself to just take over management of a MAC address, but this can be turned off.",
Create: resourceUserCreate,
Read: resourceUserRead,

View File

@@ -9,10 +9,8 @@ import (
func resourceUserGroup() *schema.Resource {
return &schema.Resource{
Description: `
unifi_user_group manages a user group (called "client group" in the UI), which can be used
to limit bandwidth for groups of users.
`,
Description: "`unifi_user_group` manages a user group (called \"client group\" in the UI), which can be used " +
"to limit bandwidth for groups of users.",
Create: resourceUserGroupCreate,
Read: resourceUserGroupRead,

View File

@@ -13,9 +13,8 @@ import (
func resourceWLAN() *schema.Resource {
return &schema.Resource{
Description: `
unifi_wlan manages a WiFi network / SSID.
`,
Description: "`unifi_wlan` manages a WiFi network / SSID.",
Create: resourceWLANCreate,
Read: resourceWLANRead,
Update: resourceWLANUpdate,

View File

@@ -8,7 +8,7 @@ description: |-
# Resource: `unifi_radius_profile`
unifi_radius_profile data source can be used to retrieve the ID for a RADIUS profile by name.
`unifi_radius_profile` data source can be used to retrieve the ID for a RADIUS profile by name.

View File

@@ -8,7 +8,7 @@ description: |-
# Resource: `unifi_user_group`
unifi_user_group data source can be used to retrieve the ID for a user group by name.
`unifi_user_group` data source can be used to retrieve the ID for a user group by name.

View File

@@ -8,7 +8,7 @@ description: |-
# Resource: `unifi_wlan_group`
unifi_wlan_group data source can be used to retrieve the ID for a WLAN group by name.
`unifi_wlan_group` data source can be used to retrieve the ID for a WLAN group by name.
## Example Usage

View File

@@ -8,9 +8,22 @@ description: |-
# Resource: `unifi_firewall_group`
unifi_firewall_group manages groups of addresses or ports for use in firewall rules (unifi_firewall_rule).
`unifi_firewall_group` manages groups of addresses or ports for use in firewall rules (`unifi_firewall_rule`).
## Example Usage
```terraform
variable "laptop_ips" {
type = list(string)
}
resource "unifi_firewall_group" "can_print" {
name = "can-print"
type = "address-group"
members = var.laptop_ips
}
```
## Schema

View File

@@ -8,9 +8,27 @@ description: |-
# Resource: `unifi_firewall_rule`
unifi_firewall_rule manages an individual firewall rule on the gateway.
`unifi_firewall_rule` manages an individual firewall rule on the gateway.
## Example Usage
```terraform
variable "ip_address" {
type = string
}
resource "unifi_firewall_rule" "drop_all" {
name = "drop all"
action = "drop"
ruleset = "LAN_IN"
rule_index = 2011
protocol = "all"
dst_address = var.ip_address
}
```
## Schema

View File

@@ -8,7 +8,7 @@ description: |-
# Resource: `unifi_network`
unifi_network manages LAN/VLAN networks.
`unifi_network` manages LAN/VLAN networks.
## Example Usage

View File

@@ -8,7 +8,7 @@ description: |-
# Resource: `unifi_port_forward`
unifi_port_forward manages a port forwarding rule on the gateway.
`unifi_port_forward` manages a port forwarding rule on the gateway.

View File

@@ -3,20 +3,15 @@ subcategory: ""
layout: ""
page_title: "terraform-provider-unifi: unifi_user"
description: |-
unifi_user manages a user (or "client" in the UI) of the network, these are identified
by unique MAC addresses.
Users are "created" in the controller when observed on the network, so the resource defaults to allowing
itself to just take over management of a MAC address, but this can be turned off.
unifi_user manages a user (or "client" in the UI) of the network, these are identified by unique MAC addresses.
Users are created in the controller when observed on the network, so the resource defaults to allowing itself to just take over management of a MAC address, but this can be turned off.
---
# Resource: `unifi_user`
unifi_user manages a user (or "client" in the UI) of the network, these are identified
by unique MAC addresses.
`unifi_user` manages a user (or "client" in the UI) of the network, these are identified by unique MAC addresses.
Users are "created" in the controller when observed on the network, so the resource defaults to allowing
itself to just take over management of a MAC address, but this can be turned off.
Users are created in the controller when observed on the network, so the resource defaults to allowing itself to just take over management of a MAC address, but this can be turned off.
## Example Usage

View File

@@ -3,14 +3,12 @@ subcategory: ""
layout: ""
page_title: "terraform-provider-unifi: unifi_user_group"
description: |-
unifi_user_group manages a user group (called "client group" in the UI), which can be used
to limit bandwidth for groups of users.
unifi_user_group manages a user group (called "client group" in the UI), which can be used to limit bandwidth for groups of users.
---
# Resource: `unifi_user_group`
unifi_user_group manages a user group (called "client group" in the UI), which can be used
to limit bandwidth for groups of users.
`unifi_user_group` manages a user group (called "client group" in the UI), which can be used to limit bandwidth for groups of users.
## Example Usage

View File

@@ -8,7 +8,7 @@ description: |-
# Resource: `unifi_wlan`
unifi_wlan manages a WiFi network / SSID.
`unifi_wlan` manages a WiFi network / SSID.
## Example Usage