feat: remove unused firewall properties from settings usg
This commit is contained in:
committed by
Mateusz Filipowicz
parent
b19314bc6e
commit
4c3d5830ad
2
.gitignore
vendored
2
.gitignore
vendored
@@ -3,3 +3,5 @@
|
|||||||
.vscode
|
.vscode
|
||||||
dist
|
dist
|
||||||
terraform-provider-unifi
|
terraform-provider-unifi
|
||||||
|
|
||||||
|
vendor/
|
||||||
2
Makefile
2
Makefile
@@ -12,4 +12,4 @@ build:
|
|||||||
|
|
||||||
.PHONY: testacc
|
.PHONY: testacc
|
||||||
testacc:
|
testacc:
|
||||||
TF_LOG=debug TF_ACC=1 go test $(TEST) -test.parallel 2 -v -count $(TEST_COUNT) -timeout $(TEST_TIMEOUT) $(TESTARGS)
|
TF_LOG_PROVIDER=debug TF_ACC=1 go test $(TEST) -test.parallel 2 -v -count $(TEST_COUNT) -timeout $(TEST_TIMEOUT) $(TESTARGS)
|
||||||
|
|||||||
@@ -188,13 +188,14 @@ func TestAccDevice_empty(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestAccDevice_switch_basic(t *testing.T) {
|
func TestAccDevice_switch_basic(t *testing.T) {
|
||||||
|
//t.Skip("FIXME")
|
||||||
resourceName := "unifi_device.test"
|
resourceName := "unifi_device.test"
|
||||||
site := "default"
|
site := "default"
|
||||||
|
|
||||||
device, unallocateDevice := allocateDevice(t)
|
device, unallocateDevice := allocateDevice(t)
|
||||||
defer unallocateDevice()
|
defer unallocateDevice()
|
||||||
|
|
||||||
importStateVerifyIgnore := []string{"allow_adoption", "forget_on_destroy"}
|
importStateVerifyIgnore := []string{"allow_adoption", "forget_on_destroy", "name"}
|
||||||
|
|
||||||
resource.ParallelTest(t, resource.TestCase{
|
resource.ParallelTest(t, resource.TestCase{
|
||||||
PreCheck: func() {
|
PreCheck: func() {
|
||||||
|
|||||||
@@ -259,12 +259,12 @@ func resourceNetwork() *schema.Resource {
|
|||||||
Optional: true,
|
Optional: true,
|
||||||
Default: true,
|
Default: true,
|
||||||
},
|
},
|
||||||
//"intra_network_access_enabled": {
|
"network_isolation_enabled": {
|
||||||
// Description: "Specifies whether this network should be allowed to access other local networks or not.",
|
Description: "Specifies whether this network should be isolated from other networks or not.",
|
||||||
// Type: schema.TypeBool,
|
Type: schema.TypeBool,
|
||||||
// Optional: true,
|
Optional: true,
|
||||||
// Default: true,
|
Default: false,
|
||||||
//},
|
},
|
||||||
"ipv6_ra_preferred_lifetime": {
|
"ipv6_ra_preferred_lifetime": {
|
||||||
Description: "Lifetime in which the address can be used. Address becomes deprecated afterwards. Must be lower than or equal to `ipv6_ra_valid_lifetime`",
|
Description: "Lifetime in which the address can be used. Address becomes deprecated afterwards. Must be lower than or equal to `ipv6_ra_valid_lifetime`",
|
||||||
Type: schema.TypeInt,
|
Type: schema.TypeInt,
|
||||||
@@ -471,8 +471,8 @@ func resourceNetworkGetResourceData(d *schema.ResourceData, meta interface{}) (*
|
|||||||
IPV6RaPriority: d.Get("ipv6_ra_priority").(string),
|
IPV6RaPriority: d.Get("ipv6_ra_priority").(string),
|
||||||
IPV6RaValidLifetime: d.Get("ipv6_ra_valid_lifetime").(int),
|
IPV6RaValidLifetime: d.Get("ipv6_ra_valid_lifetime").(int),
|
||||||
|
|
||||||
InternetAccessEnabled: d.Get("internet_access_enabled").(bool),
|
InternetAccessEnabled: d.Get("internet_access_enabled").(bool),
|
||||||
//IntraNetworkAccessEnabled: d.Get("intra_network_access_enabled").(bool),
|
NetworkIsolationEnabled: d.Get("network_isolation_enabled").(bool),
|
||||||
|
|
||||||
WANIP: d.Get("wan_ip").(string),
|
WANIP: d.Get("wan_ip").(string),
|
||||||
WANType: d.Get("wan_type").(string),
|
WANType: d.Get("wan_type").(string),
|
||||||
@@ -592,7 +592,7 @@ func resourceNetworkSetResourceData(resp *unifi.Network, d *schema.ResourceData,
|
|||||||
d.Set("enabled", resp.Enabled)
|
d.Set("enabled", resp.Enabled)
|
||||||
d.Set("igmp_snooping", resp.IGMPSnooping)
|
d.Set("igmp_snooping", resp.IGMPSnooping)
|
||||||
d.Set("internet_access_enabled", resp.InternetAccessEnabled)
|
d.Set("internet_access_enabled", resp.InternetAccessEnabled)
|
||||||
//d.Set("intra_network_access_enabled", resp.IntraNetworkAccessEnabled)
|
d.Set("network_isolation_enabled", resp.NetworkIsolationEnabled)
|
||||||
d.Set("ipv6_interface_type", resp.IPV6InterfaceType)
|
d.Set("ipv6_interface_type", resp.IPV6InterfaceType)
|
||||||
d.Set("ipv6_pd_interface", resp.IPV6PDInterface)
|
d.Set("ipv6_pd_interface", resp.IPV6PDInterface)
|
||||||
d.Set("ipv6_pd_prefixid", resp.IPV6PDPrefixid)
|
d.Set("ipv6_pd_prefixid", resp.IPV6PDPrefixid)
|
||||||
|
|||||||
@@ -52,24 +52,6 @@ func resourceSettingUsg() *schema.Resource {
|
|||||||
Optional: true,
|
Optional: true,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
"firewall_guest_default_log": {
|
|
||||||
Description: "Whether the guest firewall log is enabled.",
|
|
||||||
Type: schema.TypeBool,
|
|
||||||
Optional: true,
|
|
||||||
Computed: true,
|
|
||||||
},
|
|
||||||
"firewall_lan_default_log": {
|
|
||||||
Description: "Whether the LAN firewall log is enabled.",
|
|
||||||
Type: schema.TypeBool,
|
|
||||||
Optional: true,
|
|
||||||
Computed: true,
|
|
||||||
},
|
|
||||||
"firewall_wan_default_log": {
|
|
||||||
Description: "Whether the WAN firewall log is enabled.",
|
|
||||||
Type: schema.TypeBool,
|
|
||||||
Optional: true,
|
|
||||||
Computed: true,
|
|
||||||
},
|
|
||||||
"dhcp_relay_servers": {
|
"dhcp_relay_servers": {
|
||||||
Description: "The DHCP relay servers.",
|
Description: "The DHCP relay servers.",
|
||||||
Type: schema.TypeList,
|
Type: schema.TypeList,
|
||||||
@@ -101,10 +83,6 @@ func resourceSettingUsgUpdateResourceData(d *schema.ResourceData, meta interface
|
|||||||
setting.MdnsEnabled = mdns.(bool)
|
setting.MdnsEnabled = mdns.(bool)
|
||||||
}
|
}
|
||||||
|
|
||||||
setting.FirewallGuestDefaultLog = d.Get("firewall_guest_default_log").(bool)
|
|
||||||
setting.FirewallLanDefaultLog = d.Get("firewall_lan_default_log").(bool)
|
|
||||||
setting.FirewallWANDefaultLog = d.Get("firewall_wan_default_log").(bool)
|
|
||||||
|
|
||||||
dhcpRelay, err := listToStringSlice(d.Get("dhcp_relay_servers").([]interface{}))
|
dhcpRelay, err := listToStringSlice(d.Get("dhcp_relay_servers").([]interface{}))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("unable to convert dhcp_relay_servers to string slice: %w", err)
|
return fmt.Errorf("unable to convert dhcp_relay_servers to string slice: %w", err)
|
||||||
@@ -148,9 +126,6 @@ func resourceSettingUsgUpsert(ctx context.Context, d *schema.ResourceData, meta
|
|||||||
func resourceSettingUsgSetResourceData(resp *unifi.SettingUsg, d *schema.ResourceData, meta interface{}, site string) diag.Diagnostics {
|
func resourceSettingUsgSetResourceData(resp *unifi.SettingUsg, d *schema.ResourceData, meta interface{}, site string) diag.Diagnostics {
|
||||||
d.Set("site", site)
|
d.Set("site", site)
|
||||||
d.Set("multicast_dns_enabled", resp.MdnsEnabled)
|
d.Set("multicast_dns_enabled", resp.MdnsEnabled)
|
||||||
d.Set("firewall_guest_default_log", resp.FirewallGuestDefaultLog)
|
|
||||||
d.Set("firewall_lan_default_log", resp.FirewallLanDefaultLog)
|
|
||||||
d.Set("firewall_wan_default_log", resp.FirewallWANDefaultLog)
|
|
||||||
|
|
||||||
dhcpRelay := []string{}
|
dhcpRelay := []string{}
|
||||||
for _, s := range []string{
|
for _, s := range []string{
|
||||||
|
|||||||
Reference in New Issue
Block a user