diff --git a/examples/datasources/unifi_wlan_group/datasource.tf b/examples/data-sources/unifi_wlan_group/data-source.tf similarity index 100% rename from examples/datasources/unifi_wlan_group/datasource.tf rename to examples/data-sources/unifi_wlan_group/data-source.tf diff --git a/examples/resources/unifi_firewall_group/resource.tf b/examples/resources/unifi_firewall_group/resource.tf new file mode 100644 index 0000000..3987d11 --- /dev/null +++ b/examples/resources/unifi_firewall_group/resource.tf @@ -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 +} \ No newline at end of file diff --git a/examples/resources/unifi_firewall_rule/resource.tf b/examples/resources/unifi_firewall_rule/resource.tf new file mode 100644 index 0000000..5b68961 --- /dev/null +++ b/examples/resources/unifi_firewall_rule/resource.tf @@ -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 +} \ No newline at end of file diff --git a/internal/provider/data_radius_profile.go b/internal/provider/data_radius_profile.go index e92ad12..2c92e1b 100644 --- a/internal/provider/data_radius_profile.go +++ b/internal/provider/data_radius_profile.go @@ -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, diff --git a/internal/provider/data_user_group.go b/internal/provider/data_user_group.go index 9879f6b..c855c01 100644 --- a/internal/provider/data_user_group.go +++ b/internal/provider/data_user_group.go @@ -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, diff --git a/internal/provider/data_wlan_group.go b/internal/provider/data_wlan_group.go index bb87bb7..5ff32c4 100644 --- a/internal/provider/data_wlan_group.go +++ b/internal/provider/data_wlan_group.go @@ -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, diff --git a/internal/provider/resource_firewall_group.go b/internal/provider/resource_firewall_group.go index 8eb24f2..dff1c19 100644 --- a/internal/provider/resource_firewall_group.go +++ b/internal/provider/resource_firewall_group.go @@ -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, diff --git a/internal/provider/resource_firewall_rule.go b/internal/provider/resource_firewall_rule.go index cb9d541..1126e5b 100644 --- a/internal/provider/resource_firewall_rule.go +++ b/internal/provider/resource_firewall_rule.go @@ -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, diff --git a/internal/provider/resource_network.go b/internal/provider/resource_network.go index afdf2bf..e45e481 100644 --- a/internal/provider/resource_network.go +++ b/internal/provider/resource_network.go @@ -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, diff --git a/internal/provider/resource_port_forward.go b/internal/provider/resource_port_forward.go index b061f05..7129a54 100644 --- a/internal/provider/resource_port_forward.go +++ b/internal/provider/resource_port_forward.go @@ -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, diff --git a/internal/provider/resource_user.go b/internal/provider/resource_user.go index 85468ab..7c90336 100644 --- a/internal/provider/resource_user.go +++ b/internal/provider/resource_user.go @@ -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, diff --git a/internal/provider/resource_user_group.go b/internal/provider/resource_user_group.go index 190d2db..83f992e 100644 --- a/internal/provider/resource_user_group.go +++ b/internal/provider/resource_user_group.go @@ -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, diff --git a/internal/provider/resource_wlan.go b/internal/provider/resource_wlan.go index 9383855..8bfbab7 100644 --- a/internal/provider/resource_wlan.go +++ b/internal/provider/resource_wlan.go @@ -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, diff --git a/website/docs/d/radius_profile.html.markdown b/website/docs/data-sources/radius_profile.html.markdown similarity index 80% rename from website/docs/d/radius_profile.html.markdown rename to website/docs/data-sources/radius_profile.html.markdown index fb81278..017624d 100644 --- a/website/docs/d/radius_profile.html.markdown +++ b/website/docs/data-sources/radius_profile.html.markdown @@ -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. diff --git a/website/docs/d/user_group.html.markdown b/website/docs/data-sources/user_group.html.markdown similarity index 84% rename from website/docs/d/user_group.html.markdown rename to website/docs/data-sources/user_group.html.markdown index 565d433..0964802 100644 --- a/website/docs/d/user_group.html.markdown +++ b/website/docs/data-sources/user_group.html.markdown @@ -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. diff --git a/website/docs/d/wlan_group.html.markdown b/website/docs/data-sources/wlan_group.html.markdown similarity index 83% rename from website/docs/d/wlan_group.html.markdown rename to website/docs/data-sources/wlan_group.html.markdown index e92a3d6..d214b79 100644 --- a/website/docs/d/wlan_group.html.markdown +++ b/website/docs/data-sources/wlan_group.html.markdown @@ -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 diff --git a/website/docs/r/firewall_group.html.markdown b/website/docs/resources/firewall_group.html.markdown similarity index 65% rename from website/docs/r/firewall_group.html.markdown rename to website/docs/resources/firewall_group.html.markdown index d36fdef..bea1a4e 100644 --- a/website/docs/r/firewall_group.html.markdown +++ b/website/docs/resources/firewall_group.html.markdown @@ -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 diff --git a/website/docs/r/firewall_rule.html.markdown b/website/docs/resources/firewall_rule.html.markdown similarity index 87% rename from website/docs/r/firewall_rule.html.markdown rename to website/docs/resources/firewall_rule.html.markdown index 5966159..1e5e4cc 100644 --- a/website/docs/r/firewall_rule.html.markdown +++ b/website/docs/resources/firewall_rule.html.markdown @@ -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 diff --git a/website/docs/r/network.html.markdown b/website/docs/resources/network.html.markdown similarity index 97% rename from website/docs/r/network.html.markdown rename to website/docs/resources/network.html.markdown index 8d1c9b0..a76c6ff 100644 --- a/website/docs/r/network.html.markdown +++ b/website/docs/resources/network.html.markdown @@ -8,7 +8,7 @@ description: |- # Resource: `unifi_network` -unifi_network manages LAN/VLAN networks. +`unifi_network` manages LAN/VLAN networks. ## Example Usage diff --git a/website/docs/r/port_forward.html.markdown b/website/docs/resources/port_forward.html.markdown similarity index 94% rename from website/docs/r/port_forward.html.markdown rename to website/docs/resources/port_forward.html.markdown index a77585f..932465b 100644 --- a/website/docs/r/port_forward.html.markdown +++ b/website/docs/resources/port_forward.html.markdown @@ -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. diff --git a/website/docs/r/user.html.markdown b/website/docs/resources/user.html.markdown similarity index 72% rename from website/docs/r/user.html.markdown rename to website/docs/resources/user.html.markdown index 67de54c..f65a42c 100644 --- a/website/docs/r/user.html.markdown +++ b/website/docs/resources/user.html.markdown @@ -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 diff --git a/website/docs/r/user_group.html.markdown b/website/docs/resources/user_group.html.markdown similarity index 77% rename from website/docs/r/user_group.html.markdown rename to website/docs/resources/user_group.html.markdown index b24e894..84c03eb 100644 --- a/website/docs/r/user_group.html.markdown +++ b/website/docs/resources/user_group.html.markdown @@ -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 diff --git a/website/docs/r/wlan.html.markdown b/website/docs/resources/wlan.html.markdown similarity index 98% rename from website/docs/r/wlan.html.markdown rename to website/docs/resources/wlan.html.markdown index 0f84eed..a12343b 100644 --- a/website/docs/r/wlan.html.markdown +++ b/website/docs/resources/wlan.html.markdown @@ -8,7 +8,7 @@ description: |- # Resource: `unifi_wlan` -unifi_wlan manages a WiFi network / SSID. +`unifi_wlan` manages a WiFi network / SSID. ## Example Usage