Add site support to resources (#79)

* Add site attribute to all resources and data sourcess
* Add test to exercise site attribute on network resource
This commit is contained in:
Kurt McAlpine
2020-10-30 09:44:05 +13:00
committed by GitHub
parent 309d08aba4
commit 455ca423cc
23 changed files with 359 additions and 71 deletions

View File

@@ -21,6 +21,7 @@ data "unifi_ap_group" "default" {
### Optional
- **name** (String, Optional) The name of the AP group to look up, leave blank to look up the default AP group.
- **site** (String, Optional) The name of the site the AP group is associated with.
### Read-only

View File

@@ -16,6 +16,7 @@ description: |-
### Optional
- **name** (String, Optional) The name of the RADIUS profile to look up. Defaults to `Default`.
- **site** (String, Optional) The name of the site the radius profile is associated with.
### Read-only

View File

@@ -16,6 +16,7 @@ description: |-
### Optional
- **name** (String, Optional) The name of the user group to look up. Defaults to `Default`.
- **site** (String, Optional) The name of the site the user group is associated with.
### Read-only

View File

@@ -19,6 +19,7 @@ Please note that WLAN Groups are deprecated in v6 of the controller.
### Optional
- **name** (String, Optional) The name of the WLAN group to look up. Defaults to `Default`.
- **site** (String, Optional) The name of the site the wlan group is associated with.
### Read-only

View File

@@ -32,6 +32,10 @@ resource "unifi_firewall_group" "can_print" {
- **name** (String, Required) The name of the firewall group.
- **type** (String, Required) The type of the firewall group. Must be one of: `address-group`, `port-group`, or `ipv6-address-group`.
### Optional
- **site** (String, Optional) The name of the site to associate the firewall group with.
### Read-only
- **id** (String, Read-only) The ID of the firewall group.

View File

@@ -47,6 +47,7 @@ resource "unifi_firewall_rule" "drop_all" {
- **dst_network_type** (String, Optional) The destination network type of the firewall rule. Can be one of `ADDRv4` or `NETv4`. Defaults to `NETv4`.
- **ip_sec** (String, Optional) Specify whether the rule matches on IPsec packets. Can be one of `match-ipset` or `match-none`.
- **logging** (Boolean, Optional) Enable logging for the firewall rule.
- **site** (String, Optional) The name of the site to associate the firewall rule with.
- **src_address** (String, Optional) The source address for the firewall rule.
- **src_firewall_group_ids** (Set of String, Optional) The source firewall group IDs for the firewall rule.
- **src_mac** (String, Optional) The source MAC address of the firewall rule.

View File

@@ -62,6 +62,7 @@ resource "unifi_network" "wan" {
- **ipv6_ra_enable** (Boolean, Optional) Specifies whether to enable router advertisements or not.
- **ipv6_static_subnet** (String, Optional) Specifies the static IPv6 subnet when ipv6_interface_type is 'static'.
- **network_group** (String, Optional) The group of the network. Defaults to `LAN`.
- **site** (String, Optional) The name of the site to associate the network with.
- **subnet** (String, Optional) The subnet of the network. Must be a valid CIDR address.
- **vlan_id** (Number, Optional) The VLAN ID of the network.
- **wan_egress_qos** (Number, Optional) Specifies the WAN egress quality of service. Defaults to `0`.

View File

@@ -23,6 +23,7 @@ description: |-
- **name** (String, Optional) The name of the port forwarding rule.
- **port_forward_interface** (String, Optional) The port forwarding interface. Can be `wan`, `wan2`, or `both`.
- **protocol** (String, Optional) The protocol for the port forwarding rule. Can be `tcp`, `udp`, or `tcp_udp`. Defaults to `tcp_udp`.
- **site** (String, Optional) The name of the site to associate the port forwarding rule with.
- **src_ip** (String, Optional) The source IPv4 address (or CIDR) of the port forwarding rule. For all traffic, specify `any`. Defaults to `any`.
### Read-only

View File

@@ -39,6 +39,7 @@ resource "unifi_user" "test" {
- **fixed_ip** (String, Optional) A fixed IPv4 address for this user.
- **network_id** (String, Optional) The network ID for this user.
- **note** (String, Optional) A note with additional information for the user.
- **site** (String, Optional) The name of the site to associate the user with.
- **skip_forget_on_destroy** (Boolean, Optional) Specifies whether this resource should tell the controller to "forget" the user on destroy. Defaults to `false`.
- **user_group_id** (String, Optional) The user group ID for the user.

View File

@@ -30,6 +30,7 @@ resource "unifi_user_group" "wifi" {
- **qos_rate_max_down** (Number, Optional) The QOS maximum download rate. Defaults to `-1`.
- **qos_rate_max_up** (Number, Optional) The QOS maximum upload rate. Defaults to `-1`.
- **site** (String, Optional) The name of the site to associate the user group with.
### Read-only

View File

@@ -49,6 +49,7 @@ resource "unifi_wlan" "wifi" {
- **passphrase** (String, Optional) The passphrase for the network, this is only required if `security` is not set to `open`.
- **radius_profile_id** (String, Optional) ID of the RADIUS profile to use when security `wpaeap`. You can query this via the `unifi_radius_profile` data source.
- **schedule** (Block List) Start and stop schedules for the WLAN (see [below for nested schema](#nestedblock--schedule))
- **site** (String, Optional) The name of the site to associate the wlan with.
- **vlan_id** (Number, Optional, Deprecated) VLAN ID for the network. Set network_id instead of vlan_id for controller version >= 6.
- **wlan_group_id** (String, Optional, Deprecated) ID of the WLAN group to use for this network. Set ap_group_ids instead of wlan_group_id for controller version >= 6.