diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ace602cb..7620a3520 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,22 @@ ## 1.22.0 (Unreleased) -## 1.21.0 (Sep 12, 2024) +## 1.21.1 (Nov 1, 2024) +BUG FIXES: + +* Fix destroy issue of resource system_ftmpush; +* Fix issue of timezone could not been unset of resource system_global; +* Fix auto-generated id always show changes issue; +* Fix ip format issue; +* Fix error of set zero value of resource system_interface; +* Fix token issue of 7.4.5; + +IMPROVEMENTS: + +* Support FortiOS version 7.2.10, 7.4.5; + + +## 1.21.0 (Sep 13, 2024) BUG FIXES: * Fix global scope issue; diff --git a/fortios/data_source_firewall_address6.go b/fortios/data_source_firewall_address6.go index 8bad27ed9..a84992729 100644 --- a/fortios/data_source_firewall_address6.go +++ b/fortios/data_source_firewall_address6.go @@ -192,6 +192,14 @@ func dataSourceFirewallAddress6() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "filter": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + "sdn_addr_type": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, "fabric_object": &schema.Schema{ Type: schema.TypeString, Computed: true, @@ -547,6 +555,14 @@ func dataSourceFlattenFirewallAddress6SdnTag(v interface{}, d *schema.ResourceDa return v } +func dataSourceFlattenFirewallAddress6Filter(v interface{}, d *schema.ResourceData, pre string) interface{} { + return v +} + +func dataSourceFlattenFirewallAddress6SdnAddrType(v interface{}, d *schema.ResourceData, pre string) interface{} { + return v +} + func dataSourceFlattenFirewallAddress6FabricObject(v interface{}, d *schema.ResourceData, pre string) interface{} { return v } @@ -716,6 +732,18 @@ func dataSourceRefreshObjectFirewallAddress6(d *schema.ResourceData, o map[strin } } + if err = d.Set("filter", dataSourceFlattenFirewallAddress6Filter(o["filter"], d, "filter")); err != nil { + if !fortiAPIPatch(o["filter"]) { + return fmt.Errorf("Error reading filter: %v", err) + } + } + + if err = d.Set("sdn_addr_type", dataSourceFlattenFirewallAddress6SdnAddrType(o["sdn-addr-type"], d, "sdn_addr_type")); err != nil { + if !fortiAPIPatch(o["sdn-addr-type"]) { + return fmt.Errorf("Error reading sdn_addr_type: %v", err) + } + } + if err = d.Set("fabric_object", dataSourceFlattenFirewallAddress6FabricObject(o["fabric-object"], d, "fabric_object")); err != nil { if !fortiAPIPatch(o["fabric-object"]) { return fmt.Errorf("Error reading fabric_object: %v", err) diff --git a/fortios/data_source_system_global.go b/fortios/data_source_system_global.go index ef25e2886..9532f1938 100644 --- a/fortios/data_source_system_global.go +++ b/fortios/data_source_system_global.go @@ -973,6 +973,10 @@ func dataSourceSystemGlobal() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "rest_api_key_url_query": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, "gui_cdn_domain_override": &schema.Schema{ Type: schema.TypeString, Computed: true, @@ -2004,6 +2008,13 @@ func dataSourceFlattenSystemGlobalFortiextender(v interface{}, d *schema.Resourc } func dataSourceFlattenSystemGlobalExtenderControllerReservedNetwork(v interface{}, d *schema.ResourceData, pre string) interface{} { + if v1, ok := d.GetOkExists(pre); ok && v != nil { + if s, ok := v1.(string); ok { + v = validateConvIPMask2CIDR(s, v.(string)) + return v + } + } + return v } @@ -2222,6 +2233,10 @@ func dataSourceFlattenSystemGlobalGuiRestApiCache(v interface{}, d *schema.Resou return v } +func dataSourceFlattenSystemGlobalRestApiKeyUrlQuery(v interface{}, d *schema.ResourceData, pre string) interface{} { + return v +} + func dataSourceFlattenSystemGlobalGuiCdnDomainOverride(v interface{}, d *schema.ResourceData, pre string) interface{} { return v } @@ -3919,6 +3934,12 @@ func dataSourceRefreshObjectSystemGlobal(d *schema.ResourceData, o map[string]in } } + if err = d.Set("rest_api_key_url_query", dataSourceFlattenSystemGlobalRestApiKeyUrlQuery(o["rest-api-key-url-query"], d, "rest_api_key_url_query")); err != nil { + if !fortiAPIPatch(o["rest-api-key-url-query"]) { + return fmt.Errorf("Error reading rest_api_key_url_query: %v", err) + } + } + if err = d.Set("gui_cdn_domain_override", dataSourceFlattenSystemGlobalGuiCdnDomainOverride(o["gui-cdn-domain-override"], d, "gui_cdn_domain_override")); err != nil { if !fortiAPIPatch(o["gui-cdn-domain-override"]) { return fmt.Errorf("Error reading gui_cdn_domain_override: %v", err) diff --git a/fortios/data_source_system_interface.go b/fortios/data_source_system_interface.go index 256cf2aff..79323b221 100644 --- a/fortios/data_source_system_interface.go +++ b/fortios/data_source_system_interface.go @@ -1773,6 +1773,13 @@ func dataSourceFlattenSystemInterfaceDhcpClasslessRouteAddition(v interface{}, d } func dataSourceFlattenSystemInterfaceManagementIp(v interface{}, d *schema.ResourceData, pre string) interface{} { + if v1, ok := d.GetOkExists(pre); ok && v != nil { + if s, ok := v1.(string); ok { + v = validateConvIPMask2CIDR(s, v.(string)) + return v + } + } + return v } @@ -2257,6 +2264,13 @@ func dataSourceFlattenSystemInterfaceForwardDomain(v interface{}, d *schema.Reso } func dataSourceFlattenSystemInterfaceRemoteIp(v interface{}, d *schema.ResourceData, pre string) interface{} { + if v1, ok := d.GetOkExists(pre); ok && v != nil { + if s, ok := v1.(string); ok { + v = validateConvIPMask2CIDR(s, v.(string)) + return v + } + } + return v } @@ -2855,6 +2869,13 @@ func dataSourceFlattenSystemInterfaceSecondaryipId(v interface{}, d *schema.Reso } func dataSourceFlattenSystemInterfaceSecondaryipIp(v interface{}, d *schema.ResourceData, pre string) interface{} { + if v1, ok := d.GetOkExists(pre); ok && v != nil { + if s, ok := v1.(string); ok { + v = validateConvIPMask2CIDR(s, v.(string)) + return v + } + } + return v } diff --git a/fortios/data_source_system_sdnconnector.go b/fortios/data_source_system_sdnconnector.go index 49bc2683b..5dce2806e 100644 --- a/fortios/data_source_system_sdnconnector.go +++ b/fortios/data_source_system_sdnconnector.go @@ -186,6 +186,10 @@ func dataSourceSystemSdnConnector() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "peer_nic": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, "ip": &schema.Schema{ Type: schema.TypeList, Computed: true, @@ -195,6 +199,10 @@ func dataSourceSystemSdnConnector() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "private_ip": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, "public_ip": &schema.Schema{ Type: schema.TypeString, Computed: true, @@ -722,6 +730,11 @@ func dataSourceFlattenSystemSdnConnectorNic(v interface{}, d *schema.ResourceDat tmp["name"] = dataSourceFlattenSystemSdnConnectorNicName(i["name"], d, pre_append) } + pre_append = pre + "." + strconv.Itoa(con) + "." + "peer_nic" + if _, ok := i["peer-nic"]; ok { + tmp["peer_nic"] = dataSourceFlattenSystemSdnConnectorNicPeerNic(i["peer-nic"], d, pre_append) + } + pre_append = pre + "." + strconv.Itoa(con) + "." + "ip" if _, ok := i["ip"]; ok { tmp["ip"] = dataSourceFlattenSystemSdnConnectorNicIp(i["ip"], d, pre_append) @@ -739,6 +752,10 @@ func dataSourceFlattenSystemSdnConnectorNicName(v interface{}, d *schema.Resourc return v } +func dataSourceFlattenSystemSdnConnectorNicPeerNic(v interface{}, d *schema.ResourceData, pre string) interface{} { + return v +} + func dataSourceFlattenSystemSdnConnectorNicIp(v interface{}, d *schema.ResourceData, pre string) []map[string]interface{} { if v == nil { return nil @@ -763,6 +780,11 @@ func dataSourceFlattenSystemSdnConnectorNicIp(v interface{}, d *schema.ResourceD tmp["name"] = dataSourceFlattenSystemSdnConnectorNicIpName(i["name"], d, pre_append) } + pre_append = pre + "." + strconv.Itoa(con) + "." + "private_ip" + if _, ok := i["private-ip"]; ok { + tmp["private_ip"] = dataSourceFlattenSystemSdnConnectorNicIpPrivateIp(i["private-ip"], d, pre_append) + } + pre_append = pre + "." + strconv.Itoa(con) + "." + "public_ip" if _, ok := i["public-ip"]; ok { tmp["public_ip"] = dataSourceFlattenSystemSdnConnectorNicIpPublicIp(i["public-ip"], d, pre_append) @@ -785,6 +807,10 @@ func dataSourceFlattenSystemSdnConnectorNicIpName(v interface{}, d *schema.Resou return v } +func dataSourceFlattenSystemSdnConnectorNicIpPrivateIp(v interface{}, d *schema.ResourceData, pre string) interface{} { + return v +} + func dataSourceFlattenSystemSdnConnectorNicIpPublicIp(v interface{}, d *schema.ResourceData, pre string) interface{} { return v } diff --git a/fortios/resource_application_list.go b/fortios/resource_application_list.go index 6bdb06c85..092e68d36 100644 --- a/fortios/resource_application_list.go +++ b/fortios/resource_application_list.go @@ -118,6 +118,7 @@ func resourceApplicationList() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "risk": &schema.Schema{ Type: schema.TypeSet, @@ -212,6 +213,7 @@ func resourceApplicationList() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "members": &schema.Schema{ Type: schema.TypeList, @@ -221,6 +223,7 @@ func resourceApplicationList() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "name": &schema.Schema{ Type: schema.TypeString, @@ -1437,8 +1440,6 @@ func expandApplicationListEntries(d *schema.ResourceData, v interface{}, pre str pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandApplicationListEntriesId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "risk" @@ -1777,8 +1778,6 @@ func expandApplicationListEntriesParameters(d *schema.ResourceData, v interface{ pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandApplicationListEntriesParametersId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "members" @@ -1824,8 +1823,6 @@ func expandApplicationListEntriesParametersMembers(d *schema.ResourceData, v int pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandApplicationListEntriesParametersMembersId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "name" diff --git a/fortios/resource_application_name.go b/fortios/resource_application_name.go index a405fc0a7..1c703edcb 100644 --- a/fortios/resource_application_name.go +++ b/fortios/resource_application_name.go @@ -117,6 +117,7 @@ func resourceApplicationName() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "metaid": &schema.Schema{ Type: schema.TypeInt, @@ -664,8 +665,6 @@ func expandApplicationNameMetadata(d *schema.ResourceData, v interface{}, pre st pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandApplicationNameMetadataId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "metaid" diff --git a/fortios/resource_application_rulesettings.go b/fortios/resource_application_rulesettings.go index d7e414afe..c40db9ab4 100644 --- a/fortios/resource_application_rulesettings.go +++ b/fortios/resource_application_rulesettings.go @@ -39,6 +39,7 @@ func resourceApplicationRuleSettings() *schema.Resource { "fosid": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, }, } @@ -231,8 +232,6 @@ func getObjectApplicationRuleSettings(d *schema.ResourceData, sv string) (*map[s } else if t != nil { obj["id"] = t } - } else if d.HasChange("fosid") { - obj["id"] = nil } return &obj, nil diff --git a/fortios/resource_casb_useractivity.go b/fortios/resource_casb_useractivity.go index c6d49c8b7..881d7157f 100644 --- a/fortios/resource_casb_useractivity.go +++ b/fortios/resource_casb_useractivity.go @@ -91,6 +91,7 @@ func resourceCasbUserActivity() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "strategy": &schema.Schema{ Type: schema.TypeString, @@ -105,6 +106,7 @@ func resourceCasbUserActivity() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "type": &schema.Schema{ Type: schema.TypeString, @@ -1073,8 +1075,6 @@ func expandCasbUserActivityMatch(d *schema.ResourceData, v interface{}, pre stri pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandCasbUserActivityMatchId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "strategy" @@ -1122,8 +1122,6 @@ func expandCasbUserActivityMatchRules(d *schema.ResourceData, v interface{}, pre pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandCasbUserActivityMatchRulesId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "type" diff --git a/fortios/resource_dlp_dictionary.go b/fortios/resource_dlp_dictionary.go index 38c8883e0..8adcf0e51 100644 --- a/fortios/resource_dlp_dictionary.go +++ b/fortios/resource_dlp_dictionary.go @@ -71,6 +71,7 @@ func resourceDlpDictionary() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "type": &schema.Schema{ Type: schema.TypeString, @@ -487,8 +488,6 @@ func expandDlpDictionaryEntries(d *schema.ResourceData, v interface{}, pre strin pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandDlpDictionaryEntriesId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "type" diff --git a/fortios/resource_dlp_profile.go b/fortios/resource_dlp_profile.go index e547ff7ca..d681e1cb6 100644 --- a/fortios/resource_dlp_profile.go +++ b/fortios/resource_dlp_profile.go @@ -66,6 +66,7 @@ func resourceDlpProfile() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "name": &schema.Schema{ Type: schema.TypeString, @@ -743,8 +744,6 @@ func expandDlpProfileRule(d *schema.ResourceData, v interface{}, pre string, sv pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandDlpProfileRuleId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "name" diff --git a/fortios/resource_dlp_sensor.go b/fortios/resource_dlp_sensor.go index c8421a7de..36d23d644 100644 --- a/fortios/resource_dlp_sensor.go +++ b/fortios/resource_dlp_sensor.go @@ -66,6 +66,7 @@ func resourceDlpSensor() *schema.Resource { Type: schema.TypeInt, ValidateFunc: validation.IntBetween(1, 32), Optional: true, + Computed: true, }, "dictionary": &schema.Schema{ Type: schema.TypeString, @@ -104,6 +105,7 @@ func resourceDlpSensor() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "name": &schema.Schema{ Type: schema.TypeString, @@ -929,8 +931,6 @@ func expandDlpSensorEntries(d *schema.ResourceData, v interface{}, pre string, s pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandDlpSensorEntriesId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "dictionary" @@ -999,8 +999,6 @@ func expandDlpSensorFilter(d *schema.ResourceData, v interface{}, pre string, sv pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandDlpSensorFilterId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "name" diff --git a/fortios/resource_dnsfilter_profile.go b/fortios/resource_dnsfilter_profile.go index ae0418743..433e80888 100644 --- a/fortios/resource_dnsfilter_profile.go +++ b/fortios/resource_dnsfilter_profile.go @@ -81,6 +81,7 @@ func resourceDnsfilterProfile() *schema.Resource { Type: schema.TypeInt, ValidateFunc: validation.IntBetween(0, 255), Optional: true, + Computed: true, }, "category": &schema.Schema{ Type: schema.TypeInt, @@ -169,6 +170,7 @@ func resourceDnsfilterProfile() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "addr_type": &schema.Schema{ Type: schema.TypeString, @@ -1006,8 +1008,6 @@ func expandDnsfilterProfileFtgdDnsFilters(d *schema.ResourceData, v interface{}, pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandDnsfilterProfileFtgdDnsFiltersId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "category" @@ -1132,8 +1132,6 @@ func expandDnsfilterProfileDnsTranslation(d *schema.ResourceData, v interface{}, pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandDnsfilterProfileDnsTranslationId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "addr_type" diff --git a/fortios/resource_endpointcontrol_profile.go b/fortios/resource_endpointcontrol_profile.go index 2d30d61da..9e1da2438 100644 --- a/fortios/resource_endpointcontrol_profile.go +++ b/fortios/resource_endpointcontrol_profile.go @@ -161,6 +161,7 @@ func resourceEndpointControlProfile() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "os_type": &schema.Schema{ Type: schema.TypeString, @@ -182,6 +183,7 @@ func resourceEndpointControlProfile() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "app_name": &schema.Schema{ Type: schema.TypeString, @@ -243,6 +245,7 @@ func resourceEndpointControlProfile() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "registry_entry": &schema.Schema{ Type: schema.TypeString, @@ -260,6 +263,7 @@ func resourceEndpointControlProfile() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "file": &schema.Schema{ Type: schema.TypeString, @@ -2395,8 +2399,6 @@ func expandEndpointControlProfileForticlientWinmacSettingsForticlientOperatingSy pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandEndpointControlProfileForticlientWinmacSettingsForticlientOperatingSystemId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "os_type" @@ -2450,8 +2452,6 @@ func expandEndpointControlProfileForticlientWinmacSettingsForticlientRunningApp( pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandEndpointControlProfileForticlientWinmacSettingsForticlientRunningAppId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "app_name" @@ -2593,8 +2593,6 @@ func expandEndpointControlProfileForticlientWinmacSettingsForticlientRegistryEnt pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandEndpointControlProfileForticlientWinmacSettingsForticlientRegistryEntryId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "registry_entry" @@ -2637,8 +2635,6 @@ func expandEndpointControlProfileForticlientWinmacSettingsForticlientOwnFile(d * pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandEndpointControlProfileForticlientWinmacSettingsForticlientOwnFileId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "file" diff --git a/fortios/resource_extendercontroller_extender1.go b/fortios/resource_extendercontroller_extender1.go index 0e90160b4..98ed3c36d 100644 --- a/fortios/resource_extendercontroller_extender1.go +++ b/fortios/resource_extendercontroller_extender1.go @@ -46,6 +46,7 @@ func resourceExtenderControllerExtender1() *schema.Resource { Type: schema.TypeString, ValidateFunc: validation.StringLenBetween(0, 19), Optional: true, + Computed: true, }, "authorized": &schema.Schema{ Type: schema.TypeString, @@ -1486,8 +1487,6 @@ func getObjectExtenderControllerExtender1(d *schema.ResourceData, sv string) (*m } else if t != nil { obj["id"] = t } - } else if d.HasChange("fosid") { - obj["id"] = nil } if v, ok := d.GetOk("authorized"); ok { diff --git a/fortios/resource_extensioncontroller_extendervap.go b/fortios/resource_extensioncontroller_extendervap.go index 491690e62..1a79c1e6a 100644 --- a/fortios/resource_extensioncontroller_extendervap.go +++ b/fortios/resource_extensioncontroller_extendervap.go @@ -361,6 +361,13 @@ func flattenExtensionControllerExtenderVapAuthServerSecret(v interface{}, d *sch } func flattenExtensionControllerExtenderVapIpAddress(v interface{}, d *schema.ResourceData, pre string, sv string) interface{} { + if v1, ok := d.GetOkExists(pre); ok && v != nil { + if s, ok := v1.(string); ok { + v = validateConvIPMask2CIDR(s, v.(string)) + return v + } + } + return v } diff --git a/fortios/resource_firewall_accessproxy.go b/fortios/resource_firewall_accessproxy.go index a4cd168b4..dc9d7b03a 100644 --- a/fortios/resource_firewall_accessproxy.go +++ b/fortios/resource_firewall_accessproxy.go @@ -117,6 +117,7 @@ func resourceFirewallAccessProxy() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "url_map": &schema.Schema{ Type: schema.TypeString, @@ -218,6 +219,7 @@ func resourceFirewallAccessProxy() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "addr_type": &schema.Schema{ Type: schema.TypeString, @@ -451,6 +453,7 @@ func resourceFirewallAccessProxy() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "url_map": &schema.Schema{ Type: schema.TypeString, @@ -552,6 +555,7 @@ func resourceFirewallAccessProxy() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "addr_type": &schema.Schema{ Type: schema.TypeString, @@ -2633,8 +2637,6 @@ func expandFirewallAccessProxyApiGateway(d *schema.ResourceData, v interface{}, pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandFirewallAccessProxyApiGatewayId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "url_map" @@ -2927,8 +2929,6 @@ func expandFirewallAccessProxyApiGatewayRealservers(d *schema.ResourceData, v in pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandFirewallAccessProxyApiGatewayRealserversId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "addr_type" @@ -3312,8 +3312,6 @@ func expandFirewallAccessProxyApiGateway6(d *schema.ResourceData, v interface{}, pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandFirewallAccessProxyApiGateway6Id(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "url_map" @@ -3606,8 +3604,6 @@ func expandFirewallAccessProxyApiGateway6Realservers(d *schema.ResourceData, v i pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandFirewallAccessProxyApiGateway6RealserversId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "addr_type" diff --git a/fortios/resource_firewall_accessproxy6.go b/fortios/resource_firewall_accessproxy6.go index 210460bde..175520ec9 100644 --- a/fortios/resource_firewall_accessproxy6.go +++ b/fortios/resource_firewall_accessproxy6.go @@ -117,6 +117,7 @@ func resourceFirewallAccessProxy6() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "url_map": &schema.Schema{ Type: schema.TypeString, @@ -218,6 +219,7 @@ func resourceFirewallAccessProxy6() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "addr_type": &schema.Schema{ Type: schema.TypeString, @@ -451,6 +453,7 @@ func resourceFirewallAccessProxy6() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "url_map": &schema.Schema{ Type: schema.TypeString, @@ -552,6 +555,7 @@ func resourceFirewallAccessProxy6() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "addr_type": &schema.Schema{ Type: schema.TypeString, @@ -2633,8 +2637,6 @@ func expandFirewallAccessProxy6ApiGateway(d *schema.ResourceData, v interface{}, pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandFirewallAccessProxy6ApiGatewayId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "url_map" @@ -2927,8 +2929,6 @@ func expandFirewallAccessProxy6ApiGatewayRealservers(d *schema.ResourceData, v i pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandFirewallAccessProxy6ApiGatewayRealserversId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "addr_type" @@ -3312,8 +3312,6 @@ func expandFirewallAccessProxy6ApiGateway6(d *schema.ResourceData, v interface{} pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandFirewallAccessProxy6ApiGateway6Id(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "url_map" @@ -3606,8 +3604,6 @@ func expandFirewallAccessProxy6ApiGateway6Realservers(d *schema.ResourceData, v pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandFirewallAccessProxy6ApiGateway6RealserversId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "addr_type" diff --git a/fortios/resource_firewall_address6.go b/fortios/resource_firewall_address6.go index 9805e6a74..0e103114d 100644 --- a/fortios/resource_firewall_address6.go +++ b/fortios/resource_firewall_address6.go @@ -229,6 +229,16 @@ func resourceFirewallAddress6() *schema.Resource { ValidateFunc: validation.StringLenBetween(0, 15), Optional: true, }, + "filter": &schema.Schema{ + Type: schema.TypeString, + ValidateFunc: validation.StringLenBetween(0, 2047), + Optional: true, + }, + "sdn_addr_type": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Computed: true, + }, "fabric_object": &schema.Schema{ Type: schema.TypeString, Optional: true, @@ -733,6 +743,14 @@ func flattenFirewallAddress6SdnTag(v interface{}, d *schema.ResourceData, pre st return v } +func flattenFirewallAddress6Filter(v interface{}, d *schema.ResourceData, pre string, sv string) interface{} { + return v +} + +func flattenFirewallAddress6SdnAddrType(v interface{}, d *schema.ResourceData, pre string, sv string) interface{} { + return v +} + func flattenFirewallAddress6FabricObject(v interface{}, d *schema.ResourceData, pre string, sv string) interface{} { return v } @@ -948,6 +966,18 @@ func refreshObjectFirewallAddress6(d *schema.ResourceData, o map[string]interfac } } + if err = d.Set("filter", flattenFirewallAddress6Filter(o["filter"], d, "filter", sv)); err != nil { + if !fortiAPIPatch(o["filter"]) { + return fmt.Errorf("Error reading filter: %v", err) + } + } + + if err = d.Set("sdn_addr_type", flattenFirewallAddress6SdnAddrType(o["sdn-addr-type"], d, "sdn_addr_type", sv)); err != nil { + if !fortiAPIPatch(o["sdn-addr-type"]) { + return fmt.Errorf("Error reading sdn_addr_type: %v", err) + } + } + if err = d.Set("fabric_object", flattenFirewallAddress6FabricObject(o["fabric-object"], d, "fabric_object", sv)); err != nil { if !fortiAPIPatch(o["fabric-object"]) { return fmt.Errorf("Error reading fabric_object: %v", err) @@ -1248,6 +1278,14 @@ func expandFirewallAddress6SdnTag(d *schema.ResourceData, v interface{}, pre str return v, nil } +func expandFirewallAddress6Filter(d *schema.ResourceData, v interface{}, pre string, sv string) (interface{}, error) { + return v, nil +} + +func expandFirewallAddress6SdnAddrType(d *schema.ResourceData, v interface{}, pre string, sv string) (interface{}, error) { + return v, nil +} + func expandFirewallAddress6FabricObject(d *schema.ResourceData, v interface{}, pre string, sv string) (interface{}, error) { return v, nil } @@ -1526,6 +1564,26 @@ func getObjectFirewallAddress6(d *schema.ResourceData, sv string) (*map[string]i obj["sdn-tag"] = nil } + if v, ok := d.GetOk("filter"); ok { + t, err := expandFirewallAddress6Filter(d, v, "filter", sv) + if err != nil { + return &obj, err + } else if t != nil { + obj["filter"] = t + } + } else if d.HasChange("filter") { + obj["filter"] = nil + } + + if v, ok := d.GetOk("sdn_addr_type"); ok { + t, err := expandFirewallAddress6SdnAddrType(d, v, "sdn_addr_type", sv) + if err != nil { + return &obj, err + } else if t != nil { + obj["sdn-addr-type"] = t + } + } + if v, ok := d.GetOk("fabric_object"); ok { t, err := expandFirewallAddress6FabricObject(d, v, "fabric_object", sv) if err != nil { diff --git a/fortios/resource_firewall_dnstranslation.go b/fortios/resource_firewall_dnstranslation.go index 822b62eb1..548f87f05 100644 --- a/fortios/resource_firewall_dnstranslation.go +++ b/fortios/resource_firewall_dnstranslation.go @@ -39,6 +39,7 @@ func resourceFirewallDnstranslation() *schema.Resource { "fosid": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "src": &schema.Schema{ Type: schema.TypeString, @@ -288,8 +289,6 @@ func getObjectFirewallDnstranslation(d *schema.ResourceData, sv string) (*map[st } else if t != nil { obj["id"] = t } - } else if d.HasChange("fosid") { - obj["id"] = nil } if v, ok := d.GetOk("src"); ok { diff --git a/fortios/resource_firewall_internetservice.go b/fortios/resource_firewall_internetservice.go index ecec60974..64a90234e 100644 --- a/fortios/resource_firewall_internetservice.go +++ b/fortios/resource_firewall_internetservice.go @@ -39,6 +39,7 @@ func resourceFirewallInternetService() *schema.Resource { "fosid": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "name": &schema.Schema{ Type: schema.TypeString, @@ -470,8 +471,6 @@ func getObjectFirewallInternetService(d *schema.ResourceData, sv string) (*map[s } else if t != nil { obj["id"] = t } - } else if d.HasChange("fosid") { - obj["id"] = nil } if v, ok := d.GetOk("name"); ok { diff --git a/fortios/resource_firewall_internetserviceaddition.go b/fortios/resource_firewall_internetserviceaddition.go index 84c2645db..19debb038 100644 --- a/fortios/resource_firewall_internetserviceaddition.go +++ b/fortios/resource_firewall_internetserviceaddition.go @@ -39,6 +39,7 @@ func resourceFirewallInternetServiceAddition() *schema.Resource { "fosid": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "comment": &schema.Schema{ Type: schema.TypeString, @@ -54,6 +55,7 @@ func resourceFirewallInternetServiceAddition() *schema.Resource { Type: schema.TypeInt, ValidateFunc: validation.IntBetween(0, 255), Optional: true, + Computed: true, }, "addr_mode": &schema.Schema{ Type: schema.TypeString, @@ -73,6 +75,7 @@ func resourceFirewallInternetServiceAddition() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "start_port": &schema.Schema{ Type: schema.TypeInt, @@ -461,8 +464,6 @@ func expandFirewallInternetServiceAdditionEntry(d *schema.ResourceData, v interf pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandFirewallInternetServiceAdditionEntryId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "addr_mode" @@ -521,8 +522,6 @@ func expandFirewallInternetServiceAdditionEntryPortRange(d *schema.ResourceData, pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandFirewallInternetServiceAdditionEntryPortRangeId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "start_port" @@ -565,8 +564,6 @@ func getObjectFirewallInternetServiceAddition(d *schema.ResourceData, sv string) } else if t != nil { obj["id"] = t } - } else if d.HasChange("fosid") { - obj["id"] = nil } if v, ok := d.GetOk("comment"); ok { diff --git a/fortios/resource_firewall_internetservicebotnet.go b/fortios/resource_firewall_internetservicebotnet.go index 9acbac4c4..7991cd364 100644 --- a/fortios/resource_firewall_internetservicebotnet.go +++ b/fortios/resource_firewall_internetservicebotnet.go @@ -39,6 +39,7 @@ func resourceFirewallInternetServiceBotnet() *schema.Resource { "fosid": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "name": &schema.Schema{ Type: schema.TypeString, @@ -250,8 +251,6 @@ func getObjectFirewallInternetServiceBotnet(d *schema.ResourceData, sv string) ( } else if t != nil { obj["id"] = t } - } else if d.HasChange("fosid") { - obj["id"] = nil } if v, ok := d.GetOk("name"); ok { diff --git a/fortios/resource_firewall_internetservicecustom.go b/fortios/resource_firewall_internetservicecustom.go index fab47dd88..20ec50973 100644 --- a/fortios/resource_firewall_internetservicecustom.go +++ b/fortios/resource_firewall_internetservicecustom.go @@ -60,6 +60,7 @@ func resourceFirewallInternetServiceCustom() *schema.Resource { Type: schema.TypeInt, ValidateFunc: validation.IntBetween(0, 255), Optional: true, + Computed: true, }, "addr_mode": &schema.Schema{ Type: schema.TypeString, @@ -79,6 +80,7 @@ func resourceFirewallInternetServiceCustom() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "start_port": &schema.Schema{ Type: schema.TypeInt, @@ -601,8 +603,6 @@ func expandFirewallInternetServiceCustomEntry(d *schema.ResourceData, v interfac pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandFirewallInternetServiceCustomEntryId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "addr_mode" @@ -675,8 +675,6 @@ func expandFirewallInternetServiceCustomEntryPortRange(d *schema.ResourceData, v pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandFirewallInternetServiceCustomEntryPortRangeId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "start_port" diff --git a/fortios/resource_firewall_internetservicedefinition.go b/fortios/resource_firewall_internetservicedefinition.go index 9ab4279b0..eb119c72a 100644 --- a/fortios/resource_firewall_internetservicedefinition.go +++ b/fortios/resource_firewall_internetservicedefinition.go @@ -39,6 +39,7 @@ func resourceFirewallInternetServiceDefinition() *schema.Resource { "fosid": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "entry": &schema.Schema{ Type: schema.TypeList, @@ -72,6 +73,7 @@ func resourceFirewallInternetServiceDefinition() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "start_port": &schema.Schema{ Type: schema.TypeInt, @@ -547,8 +549,6 @@ func expandFirewallInternetServiceDefinitionEntryPortRange(d *schema.ResourceDat pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandFirewallInternetServiceDefinitionEntryPortRangeId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "start_port" @@ -595,8 +595,6 @@ func getObjectFirewallInternetServiceDefinition(d *schema.ResourceData, sv strin } else if t != nil { obj["id"] = t } - } else if d.HasChange("fosid") { - obj["id"] = nil } if v, ok := d.GetOk("entry"); ok || d.HasChange("entry") { diff --git a/fortios/resource_firewall_internetserviceextension.go b/fortios/resource_firewall_internetserviceextension.go index 5b2dd71e6..a863b274f 100644 --- a/fortios/resource_firewall_internetserviceextension.go +++ b/fortios/resource_firewall_internetserviceextension.go @@ -39,6 +39,7 @@ func resourceFirewallInternetServiceExtension() *schema.Resource { "fosid": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "comment": &schema.Schema{ Type: schema.TypeString, @@ -54,6 +55,7 @@ func resourceFirewallInternetServiceExtension() *schema.Resource { Type: schema.TypeInt, ValidateFunc: validation.IntBetween(0, 255), Optional: true, + Computed: true, }, "addr_mode": &schema.Schema{ Type: schema.TypeString, @@ -73,6 +75,7 @@ func resourceFirewallInternetServiceExtension() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "start_port": &schema.Schema{ Type: schema.TypeInt, @@ -126,6 +129,7 @@ func resourceFirewallInternetServiceExtension() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "addr_mode": &schema.Schema{ Type: schema.TypeString, @@ -145,6 +149,7 @@ func resourceFirewallInternetServiceExtension() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "start_port": &schema.Schema{ Type: schema.TypeInt, @@ -174,6 +179,7 @@ func resourceFirewallInternetServiceExtension() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "start_ip": &schema.Schema{ Type: schema.TypeString, @@ -196,6 +202,7 @@ func resourceFirewallInternetServiceExtension() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "start_ip6": &schema.Schema{ Type: schema.TypeString, @@ -956,8 +963,6 @@ func expandFirewallInternetServiceExtensionEntry(d *schema.ResourceData, v inter pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandFirewallInternetServiceExtensionEntryId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "addr_mode" @@ -1030,8 +1035,6 @@ func expandFirewallInternetServiceExtensionEntryPortRange(d *schema.ResourceData pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandFirewallInternetServiceExtensionEntryPortRangeId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "start_port" @@ -1137,8 +1140,6 @@ func expandFirewallInternetServiceExtensionDisableEntry(d *schema.ResourceData, pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandFirewallInternetServiceExtensionDisableEntryId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "addr_mode" @@ -1218,8 +1219,6 @@ func expandFirewallInternetServiceExtensionDisableEntryPortRange(d *schema.Resou pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandFirewallInternetServiceExtensionDisableEntryPortRangeId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "start_port" @@ -1273,8 +1272,6 @@ func expandFirewallInternetServiceExtensionDisableEntryIpRange(d *schema.Resourc pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandFirewallInternetServiceExtensionDisableEntryIpRangeId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "start_ip" @@ -1324,8 +1321,6 @@ func expandFirewallInternetServiceExtensionDisableEntryIp6Range(d *schema.Resour pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandFirewallInternetServiceExtensionDisableEntryIp6RangeId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "start_ip6" @@ -1368,8 +1363,6 @@ func getObjectFirewallInternetServiceExtension(d *schema.ResourceData, sv string } else if t != nil { obj["id"] = t } - } else if d.HasChange("fosid") { - obj["id"] = nil } if v, ok := d.GetOk("comment"); ok { diff --git a/fortios/resource_firewall_internetserviceipblreason.go b/fortios/resource_firewall_internetserviceipblreason.go index 96885eaa7..e6af6e972 100644 --- a/fortios/resource_firewall_internetserviceipblreason.go +++ b/fortios/resource_firewall_internetserviceipblreason.go @@ -39,6 +39,7 @@ func resourceFirewallInternetServiceIpblReason() *schema.Resource { "fosid": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "name": &schema.Schema{ Type: schema.TypeString, @@ -250,8 +251,6 @@ func getObjectFirewallInternetServiceIpblReason(d *schema.ResourceData, sv strin } else if t != nil { obj["id"] = t } - } else if d.HasChange("fosid") { - obj["id"] = nil } if v, ok := d.GetOk("name"); ok { diff --git a/fortios/resource_firewall_internetserviceipblvendor.go b/fortios/resource_firewall_internetserviceipblvendor.go index 5d3936eb8..ff7eed720 100644 --- a/fortios/resource_firewall_internetserviceipblvendor.go +++ b/fortios/resource_firewall_internetserviceipblvendor.go @@ -39,6 +39,7 @@ func resourceFirewallInternetServiceIpblVendor() *schema.Resource { "fosid": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "name": &schema.Schema{ Type: schema.TypeString, @@ -259,8 +260,6 @@ func getObjectFirewallInternetServiceIpblVendor(d *schema.ResourceData, sv strin } else if t != nil { obj["id"] = t } - } else if d.HasChange("fosid") { - obj["id"] = nil } diff --git a/fortios/resource_firewall_internetservicelist.go b/fortios/resource_firewall_internetservicelist.go index d0f8e96d4..fc379e716 100644 --- a/fortios/resource_firewall_internetservicelist.go +++ b/fortios/resource_firewall_internetservicelist.go @@ -39,6 +39,7 @@ func resourceFirewallInternetServiceList() *schema.Resource { "fosid": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "name": &schema.Schema{ Type: schema.TypeString, @@ -250,8 +251,6 @@ func getObjectFirewallInternetServiceList(d *schema.ResourceData, sv string) (*m } else if t != nil { obj["id"] = t } - } else if d.HasChange("fosid") { - obj["id"] = nil } if v, ok := d.GetOk("name"); ok { diff --git a/fortios/resource_firewall_internetserviceowner.go b/fortios/resource_firewall_internetserviceowner.go index aa90339bb..fdffa3877 100644 --- a/fortios/resource_firewall_internetserviceowner.go +++ b/fortios/resource_firewall_internetserviceowner.go @@ -39,6 +39,7 @@ func resourceFirewallInternetServiceOwner() *schema.Resource { "fosid": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "name": &schema.Schema{ Type: schema.TypeString, @@ -250,8 +251,6 @@ func getObjectFirewallInternetServiceOwner(d *schema.ResourceData, sv string) (* } else if t != nil { obj["id"] = t } - } else if d.HasChange("fosid") { - obj["id"] = nil } if v, ok := d.GetOk("name"); ok { diff --git a/fortios/resource_firewall_internetservicereputation.go b/fortios/resource_firewall_internetservicereputation.go index ae99f1d16..311de2631 100644 --- a/fortios/resource_firewall_internetservicereputation.go +++ b/fortios/resource_firewall_internetservicereputation.go @@ -39,6 +39,7 @@ func resourceFirewallInternetServiceReputation() *schema.Resource { "fosid": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "description": &schema.Schema{ Type: schema.TypeString, @@ -250,8 +251,6 @@ func getObjectFirewallInternetServiceReputation(d *schema.ResourceData, sv strin } else if t != nil { obj["id"] = t } - } else if d.HasChange("fosid") { - obj["id"] = nil } if v, ok := d.GetOk("description"); ok { diff --git a/fortios/resource_firewall_internetservicesubapp.go b/fortios/resource_firewall_internetservicesubapp.go index 6859d9ce6..9c71b61eb 100644 --- a/fortios/resource_firewall_internetservicesubapp.go +++ b/fortios/resource_firewall_internetservicesubapp.go @@ -39,6 +39,7 @@ func resourceFirewallInternetServiceSubapp() *schema.Resource { "fosid": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "sub_app": &schema.Schema{ Type: schema.TypeSet, @@ -345,8 +346,6 @@ func getObjectFirewallInternetServiceSubapp(d *schema.ResourceData, sv string) ( } else if t != nil { obj["id"] = t } - } else if d.HasChange("fosid") { - obj["id"] = nil } if v, ok := d.GetOk("sub_app"); ok || d.HasChange("sub_app") { diff --git a/fortios/resource_firewall_proxyaddress.go b/fortios/resource_firewall_proxyaddress.go index 10fad2ca5..78f05f389 100644 --- a/fortios/resource_firewall_proxyaddress.go +++ b/fortios/resource_firewall_proxyaddress.go @@ -84,6 +84,7 @@ func resourceFirewallProxyAddress() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, }, }, @@ -129,6 +130,7 @@ func resourceFirewallProxyAddress() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "header_name": &schema.Schema{ Type: schema.TypeString, @@ -989,8 +991,6 @@ func expandFirewallProxyAddressHeaderGroup(d *schema.ResourceData, v interface{} pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandFirewallProxyAddressHeaderGroupId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "header_name" diff --git a/fortios/resource_firewall_proxypolicy.go b/fortios/resource_firewall_proxypolicy.go index fcebd9d76..5764b5adf 100644 --- a/fortios/resource_firewall_proxypolicy.go +++ b/fortios/resource_firewall_proxypolicy.go @@ -214,6 +214,7 @@ func resourceFirewallProxyPolicy() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, }, }, diff --git a/fortios/resource_firewall_sniffer.go b/fortios/resource_firewall_sniffer.go index 309e94bc4..bfb331af8 100644 --- a/fortios/resource_firewall_sniffer.go +++ b/fortios/resource_firewall_sniffer.go @@ -40,6 +40,7 @@ func resourceFirewallSniffer() *schema.Resource { Type: schema.TypeInt, ValidateFunc: validation.IntBetween(0, 9999), Optional: true, + Computed: true, }, "uuid": &schema.Schema{ Type: schema.TypeString, @@ -1301,8 +1302,6 @@ func getObjectFirewallSniffer(d *schema.ResourceData, sv string) (*map[string]in } else if t != nil { obj["id"] = t } - } else if d.HasChange("fosid") { - obj["id"] = nil } if v, ok := d.GetOk("uuid"); ok { diff --git a/fortios/resource_firewall_sslsshprofile.go b/fortios/resource_firewall_sslsshprofile.go index 42f95f409..1c8170ddc 100644 --- a/fortios/resource_firewall_sslsshprofile.go +++ b/fortios/resource_firewall_sslsshprofile.go @@ -740,6 +740,7 @@ func resourceFirewallSslSshProfile() *schema.Resource { Type: schema.TypeInt, ValidateFunc: validation.IntBetween(0, 512), Optional: true, + Computed: true, }, "type": &schema.Schema{ Type: schema.TypeString, @@ -827,6 +828,7 @@ func resourceFirewallSslSshProfile() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "ip": &schema.Schema{ Type: schema.TypeString, @@ -4161,8 +4163,6 @@ func expandFirewallSslSshProfileSslExempt(d *schema.ResourceData, v interface{}, pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandFirewallSslSshProfileSslExemptId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "type" @@ -4340,8 +4340,6 @@ func expandFirewallSslSshProfileSslServer(d *schema.ResourceData, v interface{}, pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandFirewallSslSshProfileSslServerId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "ip" diff --git a/fortios/resource_firewall_vendormac.go b/fortios/resource_firewall_vendormac.go index 93f06c0bd..5316e0a47 100644 --- a/fortios/resource_firewall_vendormac.go +++ b/fortios/resource_firewall_vendormac.go @@ -39,6 +39,7 @@ func resourceFirewallVendorMac() *schema.Resource { "fosid": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "name": &schema.Schema{ Type: schema.TypeString, @@ -298,8 +299,6 @@ func getObjectFirewallVendorMac(d *schema.ResourceData, sv string) (*map[string] } else if t != nil { obj["id"] = t } - } else if d.HasChange("fosid") { - obj["id"] = nil } diff --git a/fortios/resource_firewall_vip.go b/fortios/resource_firewall_vip.go index 198362543..d436a4622 100644 --- a/fortios/resource_firewall_vip.go +++ b/fortios/resource_firewall_vip.go @@ -45,6 +45,7 @@ func resourceFirewallVip() *schema.Resource { Type: schema.TypeInt, ValidateFunc: validation.IntBetween(0, 65535), Optional: true, + Computed: true, }, "uuid": &schema.Schema{ Type: schema.TypeString, @@ -304,6 +305,7 @@ func resourceFirewallVip() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "type": &schema.Schema{ Type: schema.TypeString, @@ -2956,8 +2958,6 @@ func expandFirewallVipRealservers(d *schema.ResourceData, v interface{}, pre str pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandFirewallVipRealserversId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "type" @@ -3562,8 +3562,6 @@ func getObjectFirewallVip(d *schema.ResourceData, sv string) (*map[string]interf } else if t != nil { obj["id"] = t } - } else if d.HasChange("fosid") { - obj["id"] = nil } if v, ok := d.GetOk("uuid"); ok { diff --git a/fortios/resource_firewall_vip46.go b/fortios/resource_firewall_vip46.go index 2483c42b0..5c52d33e3 100644 --- a/fortios/resource_firewall_vip46.go +++ b/fortios/resource_firewall_vip46.go @@ -45,6 +45,7 @@ func resourceFirewallVip46() *schema.Resource { Type: schema.TypeInt, ValidateFunc: validation.IntBetween(0, 65535), Optional: true, + Computed: true, }, "uuid": &schema.Schema{ Type: schema.TypeString, @@ -140,6 +141,7 @@ func resourceFirewallVip46() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "ip": &schema.Schema{ Type: schema.TypeString, @@ -980,8 +982,6 @@ func expandFirewallVip46Realservers(d *schema.ResourceData, v interface{}, pre s pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandFirewallVip46RealserversId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "ip" @@ -1152,8 +1152,6 @@ func getObjectFirewallVip46(d *schema.ResourceData, sv string) (*map[string]inte } else if t != nil { obj["id"] = t } - } else if d.HasChange("fosid") { - obj["id"] = nil } if v, ok := d.GetOk("uuid"); ok { diff --git a/fortios/resource_firewall_vip6.go b/fortios/resource_firewall_vip6.go index 160b52ee9..278f54616 100644 --- a/fortios/resource_firewall_vip6.go +++ b/fortios/resource_firewall_vip6.go @@ -45,6 +45,7 @@ func resourceFirewallVip6() *schema.Resource { Type: schema.TypeInt, ValidateFunc: validation.IntBetween(0, 65535), Optional: true, + Computed: true, }, "uuid": &schema.Schema{ Type: schema.TypeString, @@ -236,6 +237,7 @@ func resourceFirewallVip6() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "ip": &schema.Schema{ Type: schema.TypeString, @@ -2287,8 +2289,6 @@ func expandFirewallVip6Realservers(d *schema.ResourceData, v interface{}, pre st pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandFirewallVip6RealserversId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "ip" @@ -2803,8 +2803,6 @@ func getObjectFirewallVip6(d *schema.ResourceData, sv string) (*map[string]inter } else if t != nil { obj["id"] = t } - } else if d.HasChange("fosid") { - obj["id"] = nil } if v, ok := d.GetOk("uuid"); ok { diff --git a/fortios/resource_firewall_vip64.go b/fortios/resource_firewall_vip64.go index 6ee019b64..4580e21eb 100644 --- a/fortios/resource_firewall_vip64.go +++ b/fortios/resource_firewall_vip64.go @@ -45,6 +45,7 @@ func resourceFirewallVip64() *schema.Resource { Type: schema.TypeInt, ValidateFunc: validation.IntBetween(0, 65535), Optional: true, + Computed: true, }, "uuid": &schema.Schema{ Type: schema.TypeString, @@ -127,6 +128,7 @@ func resourceFirewallVip64() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "ip": &schema.Schema{ Type: schema.TypeString, @@ -881,8 +883,6 @@ func expandFirewallVip64Realservers(d *schema.ResourceData, v interface{}, pre s pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandFirewallVip64RealserversId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "ip" @@ -1053,8 +1053,6 @@ func getObjectFirewallVip64(d *schema.ResourceData, sv string) (*map[string]inte } else if t != nil { obj["id"] = t } - } else if d.HasChange("fosid") { - obj["id"] = nil } if v, ok := d.GetOk("uuid"); ok { diff --git a/fortios/resource_firewallservice_custom.go b/fortios/resource_firewallservice_custom.go index 15eeeb933..6ce5d9bf6 100644 --- a/fortios/resource_firewallservice_custom.go +++ b/fortios/resource_firewallservice_custom.go @@ -170,6 +170,7 @@ func resourceFirewallServiceCustom() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, }, }, @@ -182,6 +183,7 @@ func resourceFirewallServiceCustom() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, }, }, diff --git a/fortios/resource_icap_profile.go b/fortios/resource_icap_profile.go index 549e2d883..bdff7dd03 100644 --- a/fortios/resource_icap_profile.go +++ b/fortios/resource_icap_profile.go @@ -230,6 +230,7 @@ func resourceIcapProfile() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "header_name": &schema.Schema{ Type: schema.TypeString, @@ -1269,8 +1270,6 @@ func expandIcapProfileRespmodForwardRulesHeaderGroup(d *schema.ResourceData, v i pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandIcapProfileRespmodForwardRulesHeaderGroupId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "header_name" diff --git a/fortios/resource_ips_rule.go b/fortios/resource_ips_rule.go index ac647f402..52fabaccf 100644 --- a/fortios/resource_ips_rule.go +++ b/fortios/resource_ips_rule.go @@ -108,6 +108,7 @@ func resourceIpsRule() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "metaid": &schema.Schema{ Type: schema.TypeInt, @@ -592,8 +593,6 @@ func expandIpsRuleMetadata(d *schema.ResourceData, v interface{}, pre string, sv pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandIpsRuleMetadataId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "metaid" diff --git a/fortios/resource_ips_rulesettings.go b/fortios/resource_ips_rulesettings.go index f139d48ea..9ffaed861 100644 --- a/fortios/resource_ips_rulesettings.go +++ b/fortios/resource_ips_rulesettings.go @@ -39,6 +39,7 @@ func resourceIpsRuleSettings() *schema.Resource { "fosid": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, }, } @@ -231,8 +232,6 @@ func getObjectIpsRuleSettings(d *schema.ResourceData, sv string) (*map[string]in } else if t != nil { obj["id"] = t } - } else if d.HasChange("fosid") { - obj["id"] = nil } return &obj, nil diff --git a/fortios/resource_ips_sensor.go b/fortios/resource_ips_sensor.go index 05e8c1f5a..d38962141 100644 --- a/fortios/resource_ips_sensor.go +++ b/fortios/resource_ips_sensor.go @@ -75,6 +75,7 @@ func resourceIpsSensor() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "rule": &schema.Schema{ Type: schema.TypeSet, @@ -206,6 +207,7 @@ func resourceIpsSensor() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "src_ip": &schema.Schema{ Type: schema.TypeString, @@ -344,6 +346,7 @@ func resourceIpsSensor() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "src_ip": &schema.Schema{ Type: schema.TypeString, @@ -1517,8 +1520,6 @@ func expandIpsSensorEntries(d *schema.ResourceData, v interface{}, pre string, s pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandIpsSensorEntriesId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "rule" @@ -1834,8 +1835,6 @@ func expandIpsSensorEntriesExemptIp(d *schema.ResourceData, v interface{}, pre s pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandIpsSensorEntriesExemptIpId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "src_ip" @@ -2179,8 +2178,6 @@ func expandIpsSensorOverrideExemptIp(d *schema.ResourceData, v interface{}, pre pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandIpsSensorOverrideExemptIpId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "src_ip" diff --git a/fortios/resource_log_threatweight.go b/fortios/resource_log_threatweight.go index bb9eceaed..343a736b5 100644 --- a/fortios/resource_log_threatweight.go +++ b/fortios/resource_log_threatweight.go @@ -248,6 +248,7 @@ func resourceLogThreatWeight() *schema.Resource { Type: schema.TypeInt, ValidateFunc: validation.IntBetween(0, 255), Optional: true, + Computed: true, }, "category": &schema.Schema{ Type: schema.TypeInt, @@ -271,6 +272,7 @@ func resourceLogThreatWeight() *schema.Resource { Type: schema.TypeInt, ValidateFunc: validation.IntBetween(0, 255), Optional: true, + Computed: true, }, "country": &schema.Schema{ Type: schema.TypeString, @@ -294,6 +296,7 @@ func resourceLogThreatWeight() *schema.Resource { Type: schema.TypeInt, ValidateFunc: validation.IntBetween(0, 255), Optional: true, + Computed: true, }, "category": &schema.Schema{ Type: schema.TypeInt, @@ -1507,8 +1510,6 @@ func expandLogThreatWeightWeb(d *schema.ResourceData, v interface{}, pre string, pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandLogThreatWeightWebId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "category" @@ -1560,8 +1561,6 @@ func expandLogThreatWeightGeolocation(d *schema.ResourceData, v interface{}, pre pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandLogThreatWeightGeolocationId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "country" @@ -1613,8 +1612,6 @@ func expandLogThreatWeightApplication(d *schema.ResourceData, v interface{}, pre pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandLogThreatWeightApplicationId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "category" diff --git a/fortios/resource_logdisk_filter.go b/fortios/resource_logdisk_filter.go index 6dee44f9f..c980184ba 100644 --- a/fortios/resource_logdisk_filter.go +++ b/fortios/resource_logdisk_filter.go @@ -112,6 +112,7 @@ func resourceLogDiskFilter() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "category": &schema.Schema{ Type: schema.TypeString, @@ -885,8 +886,6 @@ func expandLogDiskFilterFreeStyle(d *schema.ResourceData, v interface{}, pre str pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandLogDiskFilterFreeStyleId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "category" diff --git a/fortios/resource_logfortianalyzer2_filter.go b/fortios/resource_logfortianalyzer2_filter.go index 3efb4e48f..76be56fbe 100644 --- a/fortios/resource_logfortianalyzer2_filter.go +++ b/fortios/resource_logfortianalyzer2_filter.go @@ -112,6 +112,7 @@ func resourceLogFortianalyzer2Filter() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "category": &schema.Schema{ Type: schema.TypeString, @@ -633,8 +634,6 @@ func expandLogFortianalyzer2FilterFreeStyle(d *schema.ResourceData, v interface{ pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandLogFortianalyzer2FilterFreeStyleId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "category" diff --git a/fortios/resource_logfortianalyzer2_overridefilter.go b/fortios/resource_logfortianalyzer2_overridefilter.go index 0fd7a04c9..b7007752d 100644 --- a/fortios/resource_logfortianalyzer2_overridefilter.go +++ b/fortios/resource_logfortianalyzer2_overridefilter.go @@ -112,6 +112,7 @@ func resourceLogFortianalyzer2OverrideFilter() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "category": &schema.Schema{ Type: schema.TypeString, @@ -633,8 +634,6 @@ func expandLogFortianalyzer2OverrideFilterFreeStyle(d *schema.ResourceData, v in pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandLogFortianalyzer2OverrideFilterFreeStyleId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "category" diff --git a/fortios/resource_logfortianalyzer3_filter.go b/fortios/resource_logfortianalyzer3_filter.go index ee9423b38..8ccd766a2 100644 --- a/fortios/resource_logfortianalyzer3_filter.go +++ b/fortios/resource_logfortianalyzer3_filter.go @@ -112,6 +112,7 @@ func resourceLogFortianalyzer3Filter() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "category": &schema.Schema{ Type: schema.TypeString, @@ -633,8 +634,6 @@ func expandLogFortianalyzer3FilterFreeStyle(d *schema.ResourceData, v interface{ pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandLogFortianalyzer3FilterFreeStyleId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "category" diff --git a/fortios/resource_logfortianalyzer3_overridefilter.go b/fortios/resource_logfortianalyzer3_overridefilter.go index 93655c8a8..a65b89226 100644 --- a/fortios/resource_logfortianalyzer3_overridefilter.go +++ b/fortios/resource_logfortianalyzer3_overridefilter.go @@ -112,6 +112,7 @@ func resourceLogFortianalyzer3OverrideFilter() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "category": &schema.Schema{ Type: schema.TypeString, @@ -633,8 +634,6 @@ func expandLogFortianalyzer3OverrideFilterFreeStyle(d *schema.ResourceData, v in pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandLogFortianalyzer3OverrideFilterFreeStyleId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "category" diff --git a/fortios/resource_logfortianalyzer_filter.go b/fortios/resource_logfortianalyzer_filter.go index d3a9c40ea..e489a7aea 100644 --- a/fortios/resource_logfortianalyzer_filter.go +++ b/fortios/resource_logfortianalyzer_filter.go @@ -112,6 +112,7 @@ func resourceLogFortianalyzerFilter() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "category": &schema.Schema{ Type: schema.TypeString, @@ -633,8 +634,6 @@ func expandLogFortianalyzerFilterFreeStyle(d *schema.ResourceData, v interface{} pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandLogFortianalyzerFilterFreeStyleId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "category" diff --git a/fortios/resource_logfortianalyzer_overridefilter.go b/fortios/resource_logfortianalyzer_overridefilter.go index 940747341..5a318b011 100644 --- a/fortios/resource_logfortianalyzer_overridefilter.go +++ b/fortios/resource_logfortianalyzer_overridefilter.go @@ -112,6 +112,7 @@ func resourceLogFortianalyzerOverrideFilter() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "category": &schema.Schema{ Type: schema.TypeString, @@ -633,8 +634,6 @@ func expandLogFortianalyzerOverrideFilterFreeStyle(d *schema.ResourceData, v int pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandLogFortianalyzerOverrideFilterFreeStyleId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "category" diff --git a/fortios/resource_logfortianalyzercloud_filter.go b/fortios/resource_logfortianalyzercloud_filter.go index f9ca0c8d1..4a196a466 100644 --- a/fortios/resource_logfortianalyzercloud_filter.go +++ b/fortios/resource_logfortianalyzercloud_filter.go @@ -104,6 +104,7 @@ func resourceLogFortianalyzerCloudFilter() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "category": &schema.Schema{ Type: schema.TypeString, @@ -569,8 +570,6 @@ func expandLogFortianalyzerCloudFilterFreeStyle(d *schema.ResourceData, v interf pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandLogFortianalyzerCloudFilterFreeStyleId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "category" diff --git a/fortios/resource_logfortianalyzercloud_overridefilter.go b/fortios/resource_logfortianalyzercloud_overridefilter.go index 99a6d7ab6..4d1a52df5 100644 --- a/fortios/resource_logfortianalyzercloud_overridefilter.go +++ b/fortios/resource_logfortianalyzercloud_overridefilter.go @@ -104,6 +104,7 @@ func resourceLogFortianalyzerCloudOverrideFilter() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "category": &schema.Schema{ Type: schema.TypeString, @@ -569,8 +570,6 @@ func expandLogFortianalyzerCloudOverrideFilterFreeStyle(d *schema.ResourceData, pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandLogFortianalyzerCloudOverrideFilterFreeStyleId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "category" diff --git a/fortios/resource_logfortiguard_filter.go b/fortios/resource_logfortiguard_filter.go index 74cd2c2dd..05f88197c 100644 --- a/fortios/resource_logfortiguard_filter.go +++ b/fortios/resource_logfortiguard_filter.go @@ -111,6 +111,7 @@ func resourceLogFortiguardFilter() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "category": &schema.Schema{ Type: schema.TypeString, @@ -632,8 +633,6 @@ func expandLogFortiguardFilterFreeStyle(d *schema.ResourceData, v interface{}, p pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandLogFortiguardFilterFreeStyleId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "category" diff --git a/fortios/resource_logfortiguard_overridefilter.go b/fortios/resource_logfortiguard_overridefilter.go index 0df992a46..e46164a1d 100644 --- a/fortios/resource_logfortiguard_overridefilter.go +++ b/fortios/resource_logfortiguard_overridefilter.go @@ -111,6 +111,7 @@ func resourceLogFortiguardOverrideFilter() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "category": &schema.Schema{ Type: schema.TypeString, @@ -632,8 +633,6 @@ func expandLogFortiguardOverrideFilterFreeStyle(d *schema.ResourceData, v interf pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandLogFortiguardOverrideFilterFreeStyleId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "category" diff --git a/fortios/resource_logmemory_filter.go b/fortios/resource_logmemory_filter.go index e14e37278..6320cede2 100644 --- a/fortios/resource_logmemory_filter.go +++ b/fortios/resource_logmemory_filter.go @@ -107,6 +107,7 @@ func resourceLogMemoryFilter() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "category": &schema.Schema{ Type: schema.TypeString, @@ -866,8 +867,6 @@ func expandLogMemoryFilterFreeStyle(d *schema.ResourceData, v interface{}, pre s pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandLogMemoryFilterFreeStyleId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "category" diff --git a/fortios/resource_lognulldevice_filter.go b/fortios/resource_lognulldevice_filter.go index 5b9c1ef02..7c42625d6 100644 --- a/fortios/resource_lognulldevice_filter.go +++ b/fortios/resource_lognulldevice_filter.go @@ -107,6 +107,7 @@ func resourceLogNullDeviceFilter() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "category": &schema.Schema{ Type: schema.TypeString, @@ -614,8 +615,6 @@ func expandLogNullDeviceFilterFreeStyle(d *schema.ResourceData, v interface{}, p pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandLogNullDeviceFilterFreeStyleId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "category" diff --git a/fortios/resource_logsyslogd2_filter.go b/fortios/resource_logsyslogd2_filter.go index 68938a9e9..90f41204f 100644 --- a/fortios/resource_logsyslogd2_filter.go +++ b/fortios/resource_logsyslogd2_filter.go @@ -107,6 +107,7 @@ func resourceLogSyslogd2Filter() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "category": &schema.Schema{ Type: schema.TypeString, @@ -614,8 +615,6 @@ func expandLogSyslogd2FilterFreeStyle(d *schema.ResourceData, v interface{}, pre pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandLogSyslogd2FilterFreeStyleId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "category" diff --git a/fortios/resource_logsyslogd2_overridefilter.go b/fortios/resource_logsyslogd2_overridefilter.go index 7fb6fcbbc..77ddc8b16 100644 --- a/fortios/resource_logsyslogd2_overridefilter.go +++ b/fortios/resource_logsyslogd2_overridefilter.go @@ -107,6 +107,7 @@ func resourceLogSyslogd2OverrideFilter() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "category": &schema.Schema{ Type: schema.TypeString, @@ -614,8 +615,6 @@ func expandLogSyslogd2OverrideFilterFreeStyle(d *schema.ResourceData, v interfac pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandLogSyslogd2OverrideFilterFreeStyleId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "category" diff --git a/fortios/resource_logsyslogd2_overridesetting.go b/fortios/resource_logsyslogd2_overridesetting.go index 999a987e4..2d87a9c10 100644 --- a/fortios/resource_logsyslogd2_overridesetting.go +++ b/fortios/resource_logsyslogd2_overridesetting.go @@ -120,6 +120,7 @@ func resourceLogSyslogd2OverrideSetting() *schema.Resource { Type: schema.TypeInt, ValidateFunc: validation.IntBetween(0, 255), Optional: true, + Computed: true, }, "name": &schema.Schema{ Type: schema.TypeString, @@ -628,8 +629,6 @@ func expandLogSyslogd2OverrideSettingCustomFieldName(d *schema.ResourceData, v i pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandLogSyslogd2OverrideSettingCustomFieldNameId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "name" diff --git a/fortios/resource_logsyslogd2_setting.go b/fortios/resource_logsyslogd2_setting.go index f97607c41..c94943802 100644 --- a/fortios/resource_logsyslogd2_setting.go +++ b/fortios/resource_logsyslogd2_setting.go @@ -111,6 +111,7 @@ func resourceLogSyslogd2Setting() *schema.Resource { Type: schema.TypeInt, ValidateFunc: validation.IntBetween(0, 255), Optional: true, + Computed: true, }, "name": &schema.Schema{ Type: schema.TypeString, @@ -590,8 +591,6 @@ func expandLogSyslogd2SettingCustomFieldName(d *schema.ResourceData, v interface pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandLogSyslogd2SettingCustomFieldNameId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "name" diff --git a/fortios/resource_logsyslogd3_filter.go b/fortios/resource_logsyslogd3_filter.go index a0d3101eb..01033091e 100644 --- a/fortios/resource_logsyslogd3_filter.go +++ b/fortios/resource_logsyslogd3_filter.go @@ -107,6 +107,7 @@ func resourceLogSyslogd3Filter() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "category": &schema.Schema{ Type: schema.TypeString, @@ -614,8 +615,6 @@ func expandLogSyslogd3FilterFreeStyle(d *schema.ResourceData, v interface{}, pre pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandLogSyslogd3FilterFreeStyleId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "category" diff --git a/fortios/resource_logsyslogd3_overridefilter.go b/fortios/resource_logsyslogd3_overridefilter.go index 3a4a219c7..e70502a94 100644 --- a/fortios/resource_logsyslogd3_overridefilter.go +++ b/fortios/resource_logsyslogd3_overridefilter.go @@ -107,6 +107,7 @@ func resourceLogSyslogd3OverrideFilter() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "category": &schema.Schema{ Type: schema.TypeString, @@ -614,8 +615,6 @@ func expandLogSyslogd3OverrideFilterFreeStyle(d *schema.ResourceData, v interfac pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandLogSyslogd3OverrideFilterFreeStyleId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "category" diff --git a/fortios/resource_logsyslogd3_overridesetting.go b/fortios/resource_logsyslogd3_overridesetting.go index d973523dc..960e2e4fd 100644 --- a/fortios/resource_logsyslogd3_overridesetting.go +++ b/fortios/resource_logsyslogd3_overridesetting.go @@ -120,6 +120,7 @@ func resourceLogSyslogd3OverrideSetting() *schema.Resource { Type: schema.TypeInt, ValidateFunc: validation.IntBetween(0, 255), Optional: true, + Computed: true, }, "name": &schema.Schema{ Type: schema.TypeString, @@ -628,8 +629,6 @@ func expandLogSyslogd3OverrideSettingCustomFieldName(d *schema.ResourceData, v i pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandLogSyslogd3OverrideSettingCustomFieldNameId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "name" diff --git a/fortios/resource_logsyslogd3_setting.go b/fortios/resource_logsyslogd3_setting.go index 8b42bf564..c1835b9a7 100644 --- a/fortios/resource_logsyslogd3_setting.go +++ b/fortios/resource_logsyslogd3_setting.go @@ -111,6 +111,7 @@ func resourceLogSyslogd3Setting() *schema.Resource { Type: schema.TypeInt, ValidateFunc: validation.IntBetween(0, 255), Optional: true, + Computed: true, }, "name": &schema.Schema{ Type: schema.TypeString, @@ -590,8 +591,6 @@ func expandLogSyslogd3SettingCustomFieldName(d *schema.ResourceData, v interface pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandLogSyslogd3SettingCustomFieldNameId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "name" diff --git a/fortios/resource_logsyslogd4_filter.go b/fortios/resource_logsyslogd4_filter.go index 7a4783d67..beb93f87a 100644 --- a/fortios/resource_logsyslogd4_filter.go +++ b/fortios/resource_logsyslogd4_filter.go @@ -107,6 +107,7 @@ func resourceLogSyslogd4Filter() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "category": &schema.Schema{ Type: schema.TypeString, @@ -614,8 +615,6 @@ func expandLogSyslogd4FilterFreeStyle(d *schema.ResourceData, v interface{}, pre pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandLogSyslogd4FilterFreeStyleId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "category" diff --git a/fortios/resource_logsyslogd4_overridefilter.go b/fortios/resource_logsyslogd4_overridefilter.go index 9fa6db227..191823819 100644 --- a/fortios/resource_logsyslogd4_overridefilter.go +++ b/fortios/resource_logsyslogd4_overridefilter.go @@ -107,6 +107,7 @@ func resourceLogSyslogd4OverrideFilter() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "category": &schema.Schema{ Type: schema.TypeString, @@ -614,8 +615,6 @@ func expandLogSyslogd4OverrideFilterFreeStyle(d *schema.ResourceData, v interfac pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandLogSyslogd4OverrideFilterFreeStyleId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "category" diff --git a/fortios/resource_logsyslogd4_overridesetting.go b/fortios/resource_logsyslogd4_overridesetting.go index b58edebb4..0272afd6b 100644 --- a/fortios/resource_logsyslogd4_overridesetting.go +++ b/fortios/resource_logsyslogd4_overridesetting.go @@ -120,6 +120,7 @@ func resourceLogSyslogd4OverrideSetting() *schema.Resource { Type: schema.TypeInt, ValidateFunc: validation.IntBetween(0, 255), Optional: true, + Computed: true, }, "name": &schema.Schema{ Type: schema.TypeString, @@ -628,8 +629,6 @@ func expandLogSyslogd4OverrideSettingCustomFieldName(d *schema.ResourceData, v i pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandLogSyslogd4OverrideSettingCustomFieldNameId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "name" diff --git a/fortios/resource_logsyslogd4_setting.go b/fortios/resource_logsyslogd4_setting.go index b6afa308b..96521272d 100644 --- a/fortios/resource_logsyslogd4_setting.go +++ b/fortios/resource_logsyslogd4_setting.go @@ -111,6 +111,7 @@ func resourceLogSyslogd4Setting() *schema.Resource { Type: schema.TypeInt, ValidateFunc: validation.IntBetween(0, 255), Optional: true, + Computed: true, }, "name": &schema.Schema{ Type: schema.TypeString, @@ -590,8 +591,6 @@ func expandLogSyslogd4SettingCustomFieldName(d *schema.ResourceData, v interface pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandLogSyslogd4SettingCustomFieldNameId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "name" diff --git a/fortios/resource_logsyslogd_filter.go b/fortios/resource_logsyslogd_filter.go index 07367953f..975e7d8de 100644 --- a/fortios/resource_logsyslogd_filter.go +++ b/fortios/resource_logsyslogd_filter.go @@ -107,6 +107,7 @@ func resourceLogSyslogdFilter() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "category": &schema.Schema{ Type: schema.TypeString, @@ -614,8 +615,6 @@ func expandLogSyslogdFilterFreeStyle(d *schema.ResourceData, v interface{}, pre pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandLogSyslogdFilterFreeStyleId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "category" diff --git a/fortios/resource_logsyslogd_overridefilter.go b/fortios/resource_logsyslogd_overridefilter.go index 4bb2d3000..721f5b400 100644 --- a/fortios/resource_logsyslogd_overridefilter.go +++ b/fortios/resource_logsyslogd_overridefilter.go @@ -107,6 +107,7 @@ func resourceLogSyslogdOverrideFilter() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "category": &schema.Schema{ Type: schema.TypeString, @@ -614,8 +615,6 @@ func expandLogSyslogdOverrideFilterFreeStyle(d *schema.ResourceData, v interface pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandLogSyslogdOverrideFilterFreeStyleId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "category" diff --git a/fortios/resource_logsyslogd_overridesetting.go b/fortios/resource_logsyslogd_overridesetting.go index 88b4a6777..0819bb02f 100644 --- a/fortios/resource_logsyslogd_overridesetting.go +++ b/fortios/resource_logsyslogd_overridesetting.go @@ -120,6 +120,7 @@ func resourceLogSyslogdOverrideSetting() *schema.Resource { Type: schema.TypeInt, ValidateFunc: validation.IntBetween(0, 255), Optional: true, + Computed: true, }, "name": &schema.Schema{ Type: schema.TypeString, @@ -628,8 +629,6 @@ func expandLogSyslogdOverrideSettingCustomFieldName(d *schema.ResourceData, v in pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandLogSyslogdOverrideSettingCustomFieldNameId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "name" diff --git a/fortios/resource_logsyslogd_setting.go b/fortios/resource_logsyslogd_setting.go index ab4e3b96b..18842dcf5 100644 --- a/fortios/resource_logsyslogd_setting.go +++ b/fortios/resource_logsyslogd_setting.go @@ -112,6 +112,7 @@ func resourceLogSyslogdSetting() *schema.Resource { Type: schema.TypeInt, ValidateFunc: validation.IntBetween(0, 255), Optional: true, + Computed: true, }, "name": &schema.Schema{ Type: schema.TypeString, @@ -139,6 +140,7 @@ func resourceLogSyslogdSetting() *schema.Resource { "syslog_type": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "dynamic_sort_subtable": &schema.Schema{ Type: schema.TypeString, @@ -591,8 +593,6 @@ func expandLogSyslogdSettingCustomFieldName(d *schema.ResourceData, v interface{ pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandLogSyslogdSettingCustomFieldNameId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "name" @@ -873,8 +873,6 @@ func getObjectLogSyslogdSetting(d *schema.ResourceData, setArgNil bool, sv strin obj["syslog-type"] = t } } - } else if d.HasChange("syslog_type") { - obj["syslog-type"] = nil } return &obj, nil diff --git a/fortios/resource_logwebtrends_filter.go b/fortios/resource_logwebtrends_filter.go index 855948955..0e0228ef1 100644 --- a/fortios/resource_logwebtrends_filter.go +++ b/fortios/resource_logwebtrends_filter.go @@ -107,6 +107,7 @@ func resourceLogWebtrendsFilter() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "category": &schema.Schema{ Type: schema.TypeString, @@ -614,8 +615,6 @@ func expandLogWebtrendsFilterFreeStyle(d *schema.ResourceData, v interface{}, pr pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandLogWebtrendsFilterFreeStyleId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "category" diff --git a/fortios/resource_report_layout.go b/fortios/resource_report_layout.go index ea5ff0c0a..eff94c8d6 100644 --- a/fortios/resource_report_layout.go +++ b/fortios/resource_report_layout.go @@ -156,6 +156,7 @@ func resourceReportLayout() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "description": &schema.Schema{ Type: schema.TypeString, @@ -208,6 +209,7 @@ func resourceReportLayout() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "description": &schema.Schema{ Type: schema.TypeString, @@ -251,6 +253,7 @@ func resourceReportLayout() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "description": &schema.Schema{ Type: schema.TypeString, @@ -326,6 +329,7 @@ func resourceReportLayout() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "content": &schema.Schema{ Type: schema.TypeString, @@ -1564,8 +1568,6 @@ func expandReportLayoutPageHeaderHeaderItem(d *schema.ResourceData, v interface{ pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandReportLayoutPageHeaderHeaderItemId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "description" @@ -1678,8 +1680,6 @@ func expandReportLayoutPageFooterFooterItem(d *schema.ResourceData, v interface{ pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandReportLayoutPageFooterFooterItemId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "description" @@ -1764,8 +1764,6 @@ func expandReportLayoutBodyItem(d *schema.ResourceData, v interface{}, pre strin pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandReportLayoutBodyItemId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "description" @@ -2037,8 +2035,6 @@ func expandReportLayoutBodyItemList(d *schema.ResourceData, v interface{}, pre s pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandReportLayoutBodyItemListId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "content" diff --git a/fortios/resource_router_accesslist6.go b/fortios/resource_router_accesslist6.go index 0523573ba..52534e3b2 100644 --- a/fortios/resource_router_accesslist6.go +++ b/fortios/resource_router_accesslist6.go @@ -73,6 +73,7 @@ func resourceRouterAccessList6() *schema.Resource { "flags": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, }, }, @@ -423,8 +424,6 @@ func expandRouterAccessList6Rule(d *schema.ResourceData, v interface{}, pre stri pre_append = pre + "." + strconv.Itoa(con) + "." + "flags" if _, ok := d.GetOk(pre_append); ok { tmp["flags"], _ = expandRouterAccessList6RuleFlags(d, i["flags"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["flags"] = nil } result = append(result, tmp) diff --git a/fortios/resource_router_bgp.go b/fortios/resource_router_bgp.go index 664a6c8ed..7ad38b701 100644 --- a/fortios/resource_router_bgp.go +++ b/fortios/resource_router_bgp.go @@ -2027,6 +2027,7 @@ func resourceRouterBgp() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "prefix": &schema.Schema{ Type: schema.TypeString, @@ -2054,6 +2055,7 @@ func resourceRouterBgp() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "prefix6": &schema.Schema{ Type: schema.TypeString, @@ -2118,6 +2120,7 @@ func resourceRouterBgp() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "prefix6": &schema.Schema{ Type: schema.TypeString, @@ -11382,8 +11385,6 @@ func expandRouterBgpNeighborRange(d *schema.ResourceData, v interface{}, pre str pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandRouterBgpNeighborRangeId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "prefix" @@ -11446,8 +11447,6 @@ func expandRouterBgpNeighborRange6(d *schema.ResourceData, v interface{}, pre st pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandRouterBgpNeighborRange6Id(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "prefix6" @@ -11592,8 +11591,6 @@ func expandRouterBgpNetwork6(d *schema.ResourceData, v interface{}, pre string, pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandRouterBgpNetwork6Id(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "prefix6" diff --git a/fortios/resource_router_communitylist.go b/fortios/resource_router_communitylist.go index 1d2d4c3af..1d360c16a 100644 --- a/fortios/resource_router_communitylist.go +++ b/fortios/resource_router_communitylist.go @@ -64,6 +64,7 @@ func resourceRouterCommunityList() *schema.Resource { Type: schema.TypeString, ValidateFunc: validation.StringLenBetween(0, 255), Optional: true, + Computed: true, }, "match": &schema.Schema{ Type: schema.TypeString, @@ -398,8 +399,6 @@ func expandRouterCommunityListRule(d *schema.ResourceData, v interface{}, pre st pre_append = pre + "." + strconv.Itoa(con) + "." + "regexp" if _, ok := d.GetOk(pre_append); ok { tmp["regexp"], _ = expandRouterCommunityListRuleRegexp(d, i["regexp"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["regexp"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "match" diff --git a/fortios/resource_router_isis.go b/fortios/resource_router_isis.go index 0e16b8ca2..ded0224a1 100644 --- a/fortios/resource_router_isis.go +++ b/fortios/resource_router_isis.go @@ -222,6 +222,7 @@ func resourceRouterIsis() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "net": &schema.Schema{ Type: schema.TypeString, @@ -409,6 +410,7 @@ func resourceRouterIsis() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "prefix": &schema.Schema{ Type: schema.TypeString, @@ -431,6 +433,7 @@ func resourceRouterIsis() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "prefix6": &schema.Schema{ Type: schema.TypeString, @@ -1901,8 +1904,6 @@ func expandRouterIsisIsisNet(d *schema.ResourceData, v interface{}, pre string, pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandRouterIsisIsisNetId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "net" @@ -2251,8 +2252,6 @@ func expandRouterIsisSummaryAddress(d *schema.ResourceData, v interface{}, pre s pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandRouterIsisSummaryAddressId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "prefix" @@ -2302,8 +2301,6 @@ func expandRouterIsisSummaryAddress6(d *schema.ResourceData, v interface{}, pre pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandRouterIsisSummaryAddress6Id(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "prefix6" diff --git a/fortios/resource_router_multicast.go b/fortios/resource_router_multicast.go index 5085636b7..f8acc4a33 100644 --- a/fortios/resource_router_multicast.go +++ b/fortios/resource_router_multicast.go @@ -201,6 +201,7 @@ func resourceRouterMulticast() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "ip_address": &schema.Schema{ Type: schema.TypeString, @@ -1650,8 +1651,6 @@ func expandRouterMulticastPimSmGlobalRpAddress(d *schema.ResourceData, v interfa pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandRouterMulticastPimSmGlobalRpAddressId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "ip_address" diff --git a/fortios/resource_router_multicast6.go b/fortios/resource_router_multicast6.go index ce65016d0..afdd26bfd 100644 --- a/fortios/resource_router_multicast6.go +++ b/fortios/resource_router_multicast6.go @@ -95,6 +95,7 @@ func resourceRouterMulticast6() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "ip6_address": &schema.Schema{ Type: schema.TypeString, @@ -578,8 +579,6 @@ func expandRouterMulticast6PimSmGlobalRpAddress(d *schema.ResourceData, v interf pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandRouterMulticast6PimSmGlobalRpAddressId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "ip6_address" diff --git a/fortios/resource_router_ospf.go b/fortios/resource_router_ospf.go index 64b408c4b..4375101b7 100644 --- a/fortios/resource_router_ospf.go +++ b/fortios/resource_router_ospf.go @@ -244,6 +244,7 @@ func resourceRouterOspf() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "prefix": &schema.Schema{ Type: schema.TypeString, @@ -363,6 +364,7 @@ func resourceRouterOspf() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "list": &schema.Schema{ Type: schema.TypeString, @@ -545,6 +547,7 @@ func resourceRouterOspf() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "prefix": &schema.Schema{ Type: schema.TypeString, @@ -572,6 +575,7 @@ func resourceRouterOspf() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "ip": &schema.Schema{ Type: schema.TypeString, @@ -619,6 +623,7 @@ func resourceRouterOspf() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "prefix": &schema.Schema{ Type: schema.TypeString, @@ -645,6 +650,7 @@ func resourceRouterOspf() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "access_list": &schema.Schema{ Type: schema.TypeString, @@ -2713,8 +2719,6 @@ func expandRouterOspfAreaRange(d *schema.ResourceData, v interface{}, pre string pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandRouterOspfAreaRangeId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "prefix" @@ -2964,8 +2968,6 @@ func expandRouterOspfAreaFilterList(d *schema.ResourceData, v interface{}, pre s pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandRouterOspfAreaFilterListId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "list" @@ -3341,8 +3343,6 @@ func expandRouterOspfNetwork(d *schema.ResourceData, v interface{}, pre string, pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandRouterOspfNetworkId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "prefix" @@ -3403,8 +3403,6 @@ func expandRouterOspfNeighbor(d *schema.ResourceData, v interface{}, pre string, pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandRouterOspfNeighborId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "ip" @@ -3502,8 +3500,6 @@ func expandRouterOspfSummaryAddress(d *schema.ResourceData, v interface{}, pre s pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandRouterOspfSummaryAddressId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "prefix" @@ -3564,8 +3560,6 @@ func expandRouterOspfDistributeList(d *schema.ResourceData, v interface{}, pre s pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandRouterOspfDistributeListId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "access_list" diff --git a/fortios/resource_router_ospf6.go b/fortios/resource_router_ospf6.go index 017fc1084..76bbb6be8 100644 --- a/fortios/resource_router_ospf6.go +++ b/fortios/resource_router_ospf6.go @@ -213,6 +213,7 @@ func resourceRouterOspf6() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "prefix6": &schema.Schema{ Type: schema.TypeString, @@ -527,6 +528,7 @@ func resourceRouterOspf6() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "prefix6": &schema.Schema{ Type: schema.TypeString, @@ -2189,8 +2191,6 @@ func expandRouterOspf6AreaRange(d *schema.ResourceData, v interface{}, pre strin pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandRouterOspf6AreaRangeId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "prefix6" @@ -2842,8 +2842,6 @@ func expandRouterOspf6SummaryAddress(d *schema.ResourceData, v interface{}, pre pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandRouterOspf6SummaryAddressId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "prefix6" diff --git a/fortios/resource_router_prefixlist.go b/fortios/resource_router_prefixlist.go index 0c3989087..7e2542a59 100644 --- a/fortios/resource_router_prefixlist.go +++ b/fortios/resource_router_prefixlist.go @@ -80,6 +80,7 @@ func resourceRouterPrefixList() *schema.Resource { "flags": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, }, }, @@ -444,8 +445,6 @@ func expandRouterPrefixListRule(d *schema.ResourceData, v interface{}, pre strin pre_append = pre + "." + strconv.Itoa(con) + "." + "flags" if _, ok := d.GetOk(pre_append); ok { tmp["flags"], _ = expandRouterPrefixListRuleFlags(d, i["flags"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["flags"] = nil } result = append(result, tmp) diff --git a/fortios/resource_router_prefixlist6.go b/fortios/resource_router_prefixlist6.go index 5d45de516..21ae267de 100644 --- a/fortios/resource_router_prefixlist6.go +++ b/fortios/resource_router_prefixlist6.go @@ -78,6 +78,7 @@ func resourceRouterPrefixList6() *schema.Resource { "flags": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, }, }, @@ -446,8 +447,6 @@ func expandRouterPrefixList6Rule(d *schema.ResourceData, v interface{}, pre stri pre_append = pre + "." + strconv.Itoa(con) + "." + "flags" if _, ok := d.GetOk(pre_append); ok { tmp["flags"], _ = expandRouterPrefixList6RuleFlags(d, i["flags"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["flags"] = nil } result = append(result, tmp) diff --git a/fortios/resource_router_rip.go b/fortios/resource_router_rip.go index 9c59a23ff..4ca612d16 100644 --- a/fortios/resource_router_rip.go +++ b/fortios/resource_router_rip.go @@ -124,6 +124,7 @@ func resourceRouterRip() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "ip": &schema.Schema{ Type: schema.TypeString, @@ -141,6 +142,7 @@ func resourceRouterRip() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "prefix": &schema.Schema{ Type: schema.TypeString, @@ -1413,8 +1415,6 @@ func expandRouterRipNeighbor(d *schema.ResourceData, v interface{}, pre string, pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandRouterRipNeighborId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "ip" @@ -1455,8 +1455,6 @@ func expandRouterRipNetwork(d *schema.ResourceData, v interface{}, pre string, s pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandRouterRipNetworkId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "prefix" diff --git a/fortios/resource_router_ripng.go b/fortios/resource_router_ripng.go index fe44df2fa..f2acd346d 100644 --- a/fortios/resource_router_ripng.go +++ b/fortios/resource_router_ripng.go @@ -119,6 +119,7 @@ func resourceRouterRipng() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "ip6": &schema.Schema{ Type: schema.TypeString, @@ -141,6 +142,7 @@ func resourceRouterRipng() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "prefix": &schema.Schema{ Type: schema.TypeString, @@ -158,6 +160,7 @@ func resourceRouterRipng() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "prefix6": &schema.Schema{ Type: schema.TypeString, @@ -1381,8 +1384,6 @@ func expandRouterRipngNeighbor(d *schema.ResourceData, v interface{}, pre string pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandRouterRipngNeighborId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "ip6" @@ -1434,8 +1435,6 @@ func expandRouterRipngNetwork(d *schema.ResourceData, v interface{}, pre string, pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandRouterRipngNetworkId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "prefix" @@ -1476,8 +1475,6 @@ func expandRouterRipngAggregateAddress(d *schema.ResourceData, v interface{}, pr pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandRouterRipngAggregateAddressId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "prefix6" diff --git a/fortios/resource_router_routemap.go b/fortios/resource_router_routemap.go index 43ca4c7f5..1758f9d5e 100644 --- a/fortios/resource_router_routemap.go +++ b/fortios/resource_router_routemap.go @@ -303,11 +303,13 @@ func resourceRouterRouteMap() *schema.Resource { Type: schema.TypeInt, ValidateFunc: validation.IntBetween(0, 65535), Optional: true, + Computed: true, }, "match_flags": &schema.Schema{ Type: schema.TypeInt, ValidateFunc: validation.IntBetween(0, 65535), Optional: true, + Computed: true, }, "set_route_tag": &schema.Schema{ Type: schema.TypeInt, @@ -1498,15 +1500,11 @@ func expandRouterRouteMapRule(d *schema.ResourceData, v interface{}, pre string, pre_append = pre + "." + strconv.Itoa(con) + "." + "set_flags" if _, ok := d.GetOk(pre_append); ok { tmp["set-flags"], _ = expandRouterRouteMapRuleSetFlags(d, i["set_flags"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["set-flags"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "match_flags" if _, ok := d.GetOk(pre_append); ok { tmp["match-flags"], _ = expandRouterRouteMapRuleMatchFlags(d, i["match_flags"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["match-flags"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "set_route_tag" diff --git a/fortios/resource_rule_fmwp.go b/fortios/resource_rule_fmwp.go index 60959d7fc..40f0ee45c 100644 --- a/fortios/resource_rule_fmwp.go +++ b/fortios/resource_rule_fmwp.go @@ -106,6 +106,7 @@ func resourceRuleFmwp() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "metaid": &schema.Schema{ Type: schema.TypeInt, @@ -576,8 +577,6 @@ func expandRuleFmwpMetadata(d *schema.ResourceData, v interface{}, pre string, s pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandRuleFmwpMetadataId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "metaid" diff --git a/fortios/resource_rule_otdt.go b/fortios/resource_rule_otdt.go index 7526f86bb..4f359e0fd 100644 --- a/fortios/resource_rule_otdt.go +++ b/fortios/resource_rule_otdt.go @@ -46,6 +46,7 @@ func resourceRuleOtdt() *schema.Resource { "fosid": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "category": &schema.Schema{ Type: schema.TypeInt, @@ -103,6 +104,7 @@ func resourceRuleOtdt() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "metaid": &schema.Schema{ Type: schema.TypeInt, @@ -622,8 +624,6 @@ func expandRuleOtdtMetadata(d *schema.ResourceData, v interface{}, pre string, s pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandRuleOtdtMetadataId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "metaid" @@ -679,8 +679,6 @@ func getObjectRuleOtdt(d *schema.ResourceData, sv string) (*map[string]interface } else if t != nil { obj["id"] = t } - } else if d.HasChange("fosid") { - obj["id"] = nil } if v, ok := d.GetOkExists("category"); ok { diff --git a/fortios/resource_rule_otvp.go b/fortios/resource_rule_otvp.go index 77255b34c..713661e0b 100644 --- a/fortios/resource_rule_otvp.go +++ b/fortios/resource_rule_otvp.go @@ -103,6 +103,7 @@ func resourceRuleOtvp() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "metaid": &schema.Schema{ Type: schema.TypeInt, @@ -573,8 +574,6 @@ func expandRuleOtvpMetadata(d *schema.ResourceData, v interface{}, pre string, s pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandRuleOtvpMetadataId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "metaid" diff --git a/fortios/resource_sctpfilter_profile.go b/fortios/resource_sctpfilter_profile.go index d0a264574..186c3fdcd 100644 --- a/fortios/resource_sctpfilter_profile.go +++ b/fortios/resource_sctpfilter_profile.go @@ -56,6 +56,7 @@ func resourceSctpFilterProfile() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "ppid": &schema.Schema{ Type: schema.TypeInt, @@ -387,8 +388,6 @@ func expandSctpFilterProfilePpidFilters(d *schema.ResourceData, v interface{}, p pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandSctpFilterProfilePpidFiltersId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "ppid" diff --git a/fortios/resource_switchcontroller_flowtracking.go b/fortios/resource_switchcontroller_flowtracking.go index 655c58960..b982ff914 100644 --- a/fortios/resource_switchcontroller_flowtracking.go +++ b/fortios/resource_switchcontroller_flowtracking.go @@ -162,6 +162,7 @@ func resourceSwitchControllerFlowTracking() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "ip": &schema.Schema{ Type: schema.TypeString, @@ -779,8 +780,6 @@ func expandSwitchControllerFlowTrackingAggregates(d *schema.ResourceData, v inte pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandSwitchControllerFlowTrackingAggregatesId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "ip" diff --git a/fortios/resource_switchcontroller_managedswitch.go b/fortios/resource_switchcontroller_managedswitch.go index 58bc55ba1..9e4f33558 100644 --- a/fortios/resource_switchcontroller_managedswitch.go +++ b/fortios/resource_switchcontroller_managedswitch.go @@ -597,6 +597,7 @@ func resourceSwitchControllerManagedSwitch() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, }, }, @@ -1040,6 +1041,7 @@ func resourceSwitchControllerManagedSwitch() *schema.Resource { Type: schema.TypeString, ValidateFunc: validation.StringLenBetween(0, 2), Optional: true, + Computed: true, }, "priority": &schema.Schema{ Type: schema.TypeString, @@ -1471,6 +1473,7 @@ func resourceSwitchControllerManagedSwitch() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "type": &schema.Schema{ Type: schema.TypeString, @@ -7433,8 +7436,6 @@ func expandSwitchControllerManagedSwitchStpInstance(d *schema.ResourceData, v in pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandSwitchControllerManagedSwitchStpInstanceId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "priority" @@ -8229,8 +8230,6 @@ func expandSwitchControllerManagedSwitchStaticMac(d *schema.ResourceData, v inte pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandSwitchControllerManagedSwitchStaticMacId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "type" diff --git a/fortios/resource_switchcontrolleracl_group.go b/fortios/resource_switchcontrolleracl_group.go index db9fa176f..4d46fccb6 100644 --- a/fortios/resource_switchcontrolleracl_group.go +++ b/fortios/resource_switchcontrolleracl_group.go @@ -51,6 +51,7 @@ func resourceSwitchControllerAclGroup() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, }, }, diff --git a/fortios/resource_switchcontrollerinitialconfig_template.go b/fortios/resource_switchcontrollerinitialconfig_template.go index e78071a07..6b1bff928 100644 --- a/fortios/resource_switchcontrollerinitialconfig_template.go +++ b/fortios/resource_switchcontrollerinitialconfig_template.go @@ -231,6 +231,13 @@ func flattenSwitchControllerInitialConfigTemplateVlanid(v interface{}, d *schema } func flattenSwitchControllerInitialConfigTemplateIp(v interface{}, d *schema.ResourceData, pre string, sv string) interface{} { + if v1, ok := d.GetOkExists(pre); ok && v != nil { + if s, ok := v1.(string); ok { + v = validateConvIPMask2CIDR(s, v.(string)) + return v + } + } + return v } diff --git a/fortios/resource_system_acme.go b/fortios/resource_system_acme.go index 5b4c257ac..091d7fda8 100644 --- a/fortios/resource_system_acme.go +++ b/fortios/resource_system_acme.go @@ -73,6 +73,7 @@ func resourceSystemAcme() *schema.Resource { Type: schema.TypeString, ValidateFunc: validation.StringLenBetween(0, 255), Optional: true, + Computed: true, }, "status": &schema.Schema{ Type: schema.TypeString, @@ -496,8 +497,6 @@ func expandSystemAcmeAccounts(d *schema.ResourceData, v interface{}, pre string, pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandSystemAcmeAccountsId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "status" diff --git a/fortios/resource_system_affinitypacketredistribution.go b/fortios/resource_system_affinitypacketredistribution.go index 60ef25427..6815fd9cd 100644 --- a/fortios/resource_system_affinitypacketredistribution.go +++ b/fortios/resource_system_affinitypacketredistribution.go @@ -328,8 +328,6 @@ func getObjectSystemAffinityPacketRedistribution(d *schema.ResourceData, sv stri } else if t != nil { obj["rxqid"] = t } - } else if d.HasChange("rxqid") { - obj["rxqid"] = nil } if v, ok := d.GetOk("round_robin"); ok { diff --git a/fortios/resource_system_alarm.go b/fortios/resource_system_alarm.go index 3d71c98a1..b872e0142 100644 --- a/fortios/resource_system_alarm.go +++ b/fortios/resource_system_alarm.go @@ -54,6 +54,7 @@ func resourceSystemAlarm() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "period": &schema.Schema{ Type: schema.TypeInt, @@ -112,6 +113,7 @@ func resourceSystemAlarm() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "threshold": &schema.Schema{ Type: schema.TypeInt, @@ -602,8 +604,6 @@ func expandSystemAlarmGroups(d *schema.ResourceData, v interface{}, pre string, pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandSystemAlarmGroupsId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "period" @@ -766,8 +766,6 @@ func expandSystemAlarmGroupsFwPolicyViolations(d *schema.ResourceData, v interfa pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandSystemAlarmGroupsFwPolicyViolationsId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "threshold" diff --git a/fortios/resource_system_apiuser.go b/fortios/resource_system_apiuser.go index dbbfd636c..d97d1fc7f 100644 --- a/fortios/resource_system_apiuser.go +++ b/fortios/resource_system_apiuser.go @@ -100,6 +100,7 @@ func resourceSystemApiUser() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "type": &schema.Schema{ Type: schema.TypeString, @@ -599,8 +600,6 @@ func expandSystemApiUserTrusthost(d *schema.ResourceData, v interface{}, pre str pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandSystemApiUserTrusthostId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "type" diff --git a/fortios/resource_system_automationaction.go b/fortios/resource_system_automationaction.go index 76b596417..539a3cf10 100644 --- a/fortios/resource_system_automationaction.go +++ b/fortios/resource_system_automationaction.go @@ -291,6 +291,7 @@ func resourceSystemAutomationAction() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "key": &schema.Schema{ Type: schema.TypeString, @@ -1515,8 +1516,6 @@ func expandSystemAutomationActionHttpHeaders(d *schema.ResourceData, v interface pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandSystemAutomationActionHttpHeadersId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "key" diff --git a/fortios/resource_system_automationtrigger.go b/fortios/resource_system_automationtrigger.go index 550fa3de9..7f2fed99c 100644 --- a/fortios/resource_system_automationtrigger.go +++ b/fortios/resource_system_automationtrigger.go @@ -142,6 +142,7 @@ func resourceSystemAutomationTrigger() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "name": &schema.Schema{ Type: schema.TypeString, @@ -894,8 +895,6 @@ func expandSystemAutomationTriggerFields(d *schema.ResourceData, v interface{}, pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandSystemAutomationTriggerFieldsId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "name" diff --git a/fortios/resource_system_centralmanagement.go b/fortios/resource_system_centralmanagement.go index 4cd19a63f..379a91df8 100644 --- a/fortios/resource_system_centralmanagement.go +++ b/fortios/resource_system_centralmanagement.go @@ -122,6 +122,7 @@ func resourceSystemCentralManagement() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "server_type": &schema.Schema{ Type: schema.TypeString, @@ -715,8 +716,6 @@ func expandSystemCentralManagementServerList(d *schema.ResourceData, v interface pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandSystemCentralManagementServerListId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "server_type" diff --git a/fortios/resource_system_clustersync.go b/fortios/resource_system_clustersync.go index e3b83748d..5815a72d0 100644 --- a/fortios/resource_system_clustersync.go +++ b/fortios/resource_system_clustersync.go @@ -168,6 +168,7 @@ func resourceSystemClusterSync() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "src_port_range": &schema.Schema{ Type: schema.TypeString, @@ -941,8 +942,6 @@ func expandSystemClusterSyncSessionSyncFilterCustomService(d *schema.ResourceDat pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandSystemClusterSyncSessionSyncFilterCustomServiceId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "src_port_range" diff --git a/fortios/resource_system_fabricvpn.go b/fortios/resource_system_fabricvpn.go index 9a7228578..6b3cf3d26 100644 --- a/fortios/resource_system_fabricvpn.go +++ b/fortios/resource_system_fabricvpn.go @@ -132,6 +132,7 @@ func resourceSystemFabricVpn() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "prefix": &schema.Schema{ Type: schema.TypeString, @@ -437,6 +438,13 @@ func flattenSystemFabricVpnOverlaysName(v interface{}, d *schema.ResourceData, p } func flattenSystemFabricVpnOverlaysOverlayTunnelBlock(v interface{}, d *schema.ResourceData, pre string, sv string) interface{} { + if v1, ok := d.GetOkExists(pre); ok && v != nil { + if s, ok := v1.(string); ok { + v = validateConvIPMask2CIDR(s, v.(string)) + return v + } + } + return v } @@ -575,6 +583,13 @@ func flattenSystemFabricVpnAdvertisedSubnetsPolicies(v interface{}, d *schema.Re } func flattenSystemFabricVpnLoopbackAddressBlock(v interface{}, d *schema.ResourceData, pre string, sv string) interface{} { + if v1, ok := d.GetOkExists(pre); ok && v != nil { + if s, ok := v1.(string); ok { + v = validateConvIPMask2CIDR(s, v.(string)) + return v + } + } + return v } @@ -911,8 +926,6 @@ func expandSystemFabricVpnAdvertisedSubnets(d *schema.ResourceData, v interface{ pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandSystemFabricVpnAdvertisedSubnetsId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "prefix" diff --git a/fortios/resource_system_fm.go b/fortios/resource_system_fm.go index 566cd3450..ce7e66c8a 100644 --- a/fortios/resource_system_fm.go +++ b/fortios/resource_system_fm.go @@ -45,6 +45,7 @@ func resourceSystemFm() *schema.Resource { Type: schema.TypeString, ValidateFunc: validation.StringLenBetween(0, 35), Optional: true, + Computed: true, }, "ip": &schema.Schema{ Type: schema.TypeString, @@ -327,8 +328,6 @@ func getObjectSystemFm(d *schema.ResourceData, setArgNil bool, sv string) (*map[ obj["id"] = t } } - } else if d.HasChange("fosid") { - obj["id"] = nil } if v, ok := d.GetOk("ip"); ok { diff --git a/fortios/resource_system_ftmpush.go b/fortios/resource_system_ftmpush.go index e34c425b0..00262d90c 100644 --- a/fortios/resource_system_ftmpush.go +++ b/fortios/resource_system_ftmpush.go @@ -338,15 +338,11 @@ func getObjectSystemFtmPush(d *schema.ResourceData, setArgNil bool, sv string) ( } if v, ok := d.GetOk("server"); ok { - if setArgNil { - obj["server"] = nil - } else { - t, err := expandSystemFtmPushServer(d, v, "server", sv) - if err != nil { - return &obj, err - } else if t != nil { - obj["server"] = t - } + t, err := expandSystemFtmPushServer(d, v, "server", sv) + if err != nil { + return &obj, err + } else if t != nil { + obj["server"] = t } } else if d.HasChange("server") { obj["server"] = nil diff --git a/fortios/resource_system_global.go b/fortios/resource_system_global.go index 7d4af2c1e..0c21640fa 100644 --- a/fortios/resource_system_global.go +++ b/fortios/resource_system_global.go @@ -417,6 +417,7 @@ func resourceSystemGlobal() *schema.Resource { Type: schema.TypeString, ValidateFunc: validation.StringLenBetween(0, 35), Optional: true, + Computed: true, }, "strong_crypto": &schema.Schema{ Type: schema.TypeString, @@ -1262,6 +1263,11 @@ func resourceSystemGlobal() *schema.Resource { Optional: true, Computed: true, }, + "rest_api_key_url_query": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Computed: true, + }, "gui_cdn_domain_override": &schema.Schema{ Type: schema.TypeString, ValidateFunc: validation.StringLenBetween(0, 255), @@ -1389,7 +1395,7 @@ func resourceSystemGlobal() *schema.Resource { }, "user_device_store_max_unified_mem": &schema.Schema{ Type: schema.TypeInt, - ValidateFunc: validation.IntBetween(20888780, 1682668748), + ValidateFunc: validation.IntBetween(20888698, 1682668748), Optional: true, Computed: true, }, @@ -1410,11 +1416,13 @@ func resourceSystemGlobal() *schema.Resource { Type: schema.TypeString, ValidateFunc: validation.StringLenBetween(0, 19), Optional: true, + Computed: true, }, "gui_device_longitude": &schema.Schema{ Type: schema.TypeString, ValidateFunc: validation.StringLenBetween(0, 19), Optional: true, + Computed: true, }, "private_data_encryption": &schema.Schema{ Type: schema.TypeString, @@ -2459,6 +2467,13 @@ func flattenSystemGlobalFortiextender(v interface{}, d *schema.ResourceData, pre } func flattenSystemGlobalExtenderControllerReservedNetwork(v interface{}, d *schema.ResourceData, pre string, sv string) interface{} { + if v1, ok := d.GetOkExists(pre); ok && v != nil { + if s, ok := v1.(string); ok { + v = validateConvIPMask2CIDR(s, v.(string)) + return v + } + } + return v } @@ -2677,6 +2692,10 @@ func flattenSystemGlobalGuiRestApiCache(v interface{}, d *schema.ResourceData, p return v } +func flattenSystemGlobalRestApiKeyUrlQuery(v interface{}, d *schema.ResourceData, pre string, sv string) interface{} { + return v +} + func flattenSystemGlobalGuiCdnDomainOverride(v interface{}, d *schema.ResourceData, pre string, sv string) interface{} { return v } @@ -4386,6 +4405,12 @@ func refreshObjectSystemGlobal(d *schema.ResourceData, o map[string]interface{}, } } + if err = d.Set("rest_api_key_url_query", flattenSystemGlobalRestApiKeyUrlQuery(o["rest-api-key-url-query"], d, "rest_api_key_url_query", sv)); err != nil { + if !fortiAPIPatch(o["rest-api-key-url-query"]) { + return fmt.Errorf("Error reading rest_api_key_url_query: %v", err) + } + } + if err = d.Set("gui_cdn_domain_override", flattenSystemGlobalGuiCdnDomainOverride(o["gui-cdn-domain-override"], d, "gui_cdn_domain_override", sv)); err != nil { if !fortiAPIPatch(o["gui-cdn-domain-override"]) { return fmt.Errorf("Error reading gui_cdn_domain_override: %v", err) @@ -5727,6 +5752,10 @@ func expandSystemGlobalGuiRestApiCache(d *schema.ResourceData, v interface{}, pr return v, nil } +func expandSystemGlobalRestApiKeyUrlQuery(d *schema.ResourceData, v interface{}, pre string, sv string) (interface{}, error) { + return v, nil +} + func expandSystemGlobalGuiCdnDomainOverride(d *schema.ResourceData, v interface{}, pre string, sv string) (interface{}, error) { return v, nil } @@ -6656,15 +6685,11 @@ func getObjectSystemGlobal(d *schema.ResourceData, setArgNil bool, sv string) (* } if v, ok := d.GetOk("timezone"); ok { - if setArgNil { - obj["timezone"] = nil - } else { - t, err := expandSystemGlobalTimezone(d, v, "timezone", sv) - if err != nil { - return &obj, err - } else if t != nil { - obj["timezone"] = t - } + t, err := expandSystemGlobalTimezone(d, v, "timezone", sv) + if err != nil { + return &obj, err + } else if t != nil { + obj["timezone"] = t } } @@ -6980,8 +7005,6 @@ func getObjectSystemGlobal(d *schema.ResourceData, setArgNil bool, sv string) (* obj["alias"] = t } } - } else if d.HasChange("alias") { - obj["alias"] = nil } if v, ok := d.GetOk("strong_crypto"); ok { @@ -7788,15 +7811,11 @@ func getObjectSystemGlobal(d *schema.ResourceData, setArgNil bool, sv string) (* } if v, ok := d.GetOk("vdom_mode"); ok { - if setArgNil { - obj["vdom-mode"] = nil - } else { - t, err := expandSystemGlobalVdomMode(d, v, "vdom_mode", sv) - if err != nil { - return &obj, err - } else if t != nil { - obj["vdom-mode"] = t - } + t, err := expandSystemGlobalVdomMode(d, v, "vdom_mode", sv) + if err != nil { + return &obj, err + } else if t != nil { + obj["vdom-mode"] = t } } @@ -9140,6 +9159,19 @@ func getObjectSystemGlobal(d *schema.ResourceData, setArgNil bool, sv string) (* } } + if v, ok := d.GetOk("rest_api_key_url_query"); ok { + if setArgNil { + obj["rest-api-key-url-query"] = nil + } else { + t, err := expandSystemGlobalRestApiKeyUrlQuery(d, v, "rest_api_key_url_query", sv) + if err != nil { + return &obj, err + } else if t != nil { + obj["rest-api-key-url-query"] = t + } + } + } + if v, ok := d.GetOk("gui_cdn_domain_override"); ok { if setArgNil { obj["gui-cdn-domain-override"] = nil @@ -9516,8 +9548,6 @@ func getObjectSystemGlobal(d *schema.ResourceData, setArgNil bool, sv string) (* obj["gui-device-latitude"] = t } } - } else if d.HasChange("gui_device_latitude") { - obj["gui-device-latitude"] = nil } if v, ok := d.GetOk("gui_device_longitude"); ok { @@ -9531,8 +9561,6 @@ func getObjectSystemGlobal(d *schema.ResourceData, setArgNil bool, sv string) (* obj["gui-device-longitude"] = t } } - } else if d.HasChange("gui_device_longitude") { - obj["gui-device-longitude"] = nil } if v, ok := d.GetOk("private_data_encryption"); ok { diff --git a/fortios/resource_system_ha.go b/fortios/resource_system_ha.go index 93b0dea61..e47164d78 100644 --- a/fortios/resource_system_ha.go +++ b/fortios/resource_system_ha.go @@ -270,6 +270,7 @@ func resourceSystemHa() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "interface": &schema.Schema{ Type: schema.TypeString, @@ -341,6 +342,7 @@ func resourceSystemHa() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "peer_ip": &schema.Schema{ Type: schema.TypeString, @@ -2407,8 +2409,6 @@ func expandSystemHaHaMgmtInterfaces(d *schema.ResourceData, v interface{}, pre s pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandSystemHaHaMgmtInterfacesId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "interface" @@ -2506,8 +2506,6 @@ func expandSystemHaUnicastPeers(d *schema.ResourceData, v interface{}, pre strin pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandSystemHaUnicastPeersId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "peer_ip" diff --git a/fortios/resource_system_interface.go b/fortios/resource_system_interface.go index 18c26ab60..42772f047 100644 --- a/fortios/resource_system_interface.go +++ b/fortios/resource_system_interface.go @@ -1134,6 +1134,7 @@ func resourceSystemInterface() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "ip": &schema.Schema{ Type: schema.TypeString, @@ -2251,6 +2252,13 @@ func flattenSystemInterfaceDhcpClasslessRouteAddition(v interface{}, d *schema.R } func flattenSystemInterfaceManagementIp(v interface{}, d *schema.ResourceData, pre string, sv string) interface{} { + if v1, ok := d.GetOkExists(pre); ok && v != nil { + if s, ok := v1.(string); ok { + v = validateConvIPMask2CIDR(s, v.(string)) + return v + } + } + return v } @@ -2733,6 +2741,13 @@ func flattenSystemInterfaceForwardDomain(v interface{}, d *schema.ResourceData, } func flattenSystemInterfaceRemoteIp(v interface{}, d *schema.ResourceData, pre string, sv string) interface{} { + if v1, ok := d.GetOkExists(pre); ok && v != nil { + if s, ok := v1.(string); ok { + v = validateConvIPMask2CIDR(s, v.(string)) + return v + } + } + return v } @@ -3367,6 +3382,13 @@ func flattenSystemInterfaceSecondaryipId(v interface{}, d *schema.ResourceData, } func flattenSystemInterfaceSecondaryipIp(v interface{}, d *schema.ResourceData, pre string, sv string) interface{} { + if v1, ok := d.GetOkExists(pre); ok && v != nil { + if s, ok := v1.(string); ok { + v = validateConvIPMask2CIDR(s, v.(string)) + return v + } + } + return v } @@ -7358,8 +7380,6 @@ func expandSystemInterfaceSecondaryip(d *schema.ResourceData, v interface{}, pre pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandSystemInterfaceSecondaryipId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "ip" @@ -9574,7 +9594,7 @@ func getObjectSystemInterface(d *schema.ResourceData, sv string) (*map[string]in } } - if v, ok := d.GetOkExists("ring_rx"); ok { + if v, ok := d.GetOk("ring_rx"); ok { t, err := expandSystemInterfaceRingRx(d, v, "ring_rx", sv) if err != nil { return &obj, err @@ -9585,7 +9605,7 @@ func getObjectSystemInterface(d *schema.ResourceData, sv string) (*map[string]in obj["ring-rx"] = nil } - if v, ok := d.GetOkExists("ring_tx"); ok { + if v, ok := d.GetOk("ring_tx"); ok { t, err := expandSystemInterfaceRingTx(d, v, "ring_tx", sv) if err != nil { return &obj, err diff --git a/fortios/resource_system_mobiletunnel.go b/fortios/resource_system_mobiletunnel.go index c0be74651..ef7d95d47 100644 --- a/fortios/resource_system_mobiletunnel.go +++ b/fortios/resource_system_mobiletunnel.go @@ -111,6 +111,7 @@ func resourceSystemMobileTunnel() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "interface": &schema.Schema{ Type: schema.TypeString, @@ -594,8 +595,6 @@ func expandSystemMobileTunnelNetwork(d *schema.ResourceData, v interface{}, pre pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandSystemMobileTunnelNetworkId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "interface" diff --git a/fortios/resource_system_pcpserver.go b/fortios/resource_system_pcpserver.go index 591d8dff3..09892115f 100644 --- a/fortios/resource_system_pcpserver.go +++ b/fortios/resource_system_pcpserver.go @@ -59,6 +59,7 @@ func resourceSystemPcpServer() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "client_subnet": &schema.Schema{ Type: schema.TypeSet, @@ -694,8 +695,6 @@ func expandSystemPcpServerPools(d *schema.ResourceData, v interface{}, pre strin pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandSystemPcpServerPoolsId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "client_subnet" diff --git a/fortios/resource_system_sdnconnector.go b/fortios/resource_system_sdnconnector.go index 9d774a60a..94e7965d4 100644 --- a/fortios/resource_system_sdnconnector.go +++ b/fortios/resource_system_sdnconnector.go @@ -224,6 +224,11 @@ func resourceSystemSdnConnector() *schema.Resource { ValidateFunc: validation.StringLenBetween(0, 63), Optional: true, }, + "peer_nic": &schema.Schema{ + Type: schema.TypeString, + ValidateFunc: validation.StringLenBetween(0, 63), + Optional: true, + }, "ip": &schema.Schema{ Type: schema.TypeList, Optional: true, @@ -234,6 +239,11 @@ func resourceSystemSdnConnector() *schema.Resource { ValidateFunc: validation.StringLenBetween(0, 63), Optional: true, }, + "private_ip": &schema.Schema{ + Type: schema.TypeString, + ValidateFunc: validation.StringLenBetween(0, 39), + Optional: true, + }, "public_ip": &schema.Schema{ Type: schema.TypeString, ValidateFunc: validation.StringLenBetween(0, 63), @@ -916,6 +926,11 @@ func flattenSystemSdnConnectorNic(v interface{}, d *schema.ResourceData, pre str tmp["name"] = flattenSystemSdnConnectorNicName(cur_v, d, pre_append, sv) } + pre_append = pre + "." + strconv.Itoa(con) + "." + "peer_nic" + if cur_v, ok := i["peer-nic"]; ok { + tmp["peer_nic"] = flattenSystemSdnConnectorNicPeerNic(cur_v, d, pre_append, sv) + } + pre_append = pre + "." + strconv.Itoa(con) + "." + "ip" if cur_v, ok := i["ip"]; ok { tmp["ip"] = flattenSystemSdnConnectorNicIp(cur_v, d, pre_append, sv) @@ -934,6 +949,10 @@ func flattenSystemSdnConnectorNicName(v interface{}, d *schema.ResourceData, pre return v } +func flattenSystemSdnConnectorNicPeerNic(v interface{}, d *schema.ResourceData, pre string, sv string) interface{} { + return v +} + func flattenSystemSdnConnectorNicIp(v interface{}, d *schema.ResourceData, pre string, sv string) []map[string]interface{} { if v == nil { return nil @@ -963,6 +982,11 @@ func flattenSystemSdnConnectorNicIp(v interface{}, d *schema.ResourceData, pre s tmp["name"] = flattenSystemSdnConnectorNicIpName(cur_v, d, pre_append, sv) } + pre_append = pre + "." + strconv.Itoa(con) + "." + "private_ip" + if cur_v, ok := i["private-ip"]; ok { + tmp["private_ip"] = flattenSystemSdnConnectorNicIpPrivateIp(cur_v, d, pre_append, sv) + } + pre_append = pre + "." + strconv.Itoa(con) + "." + "public_ip" if cur_v, ok := i["public-ip"]; ok { tmp["public_ip"] = flattenSystemSdnConnectorNicIpPublicIp(cur_v, d, pre_append, sv) @@ -986,6 +1010,10 @@ func flattenSystemSdnConnectorNicIpName(v interface{}, d *schema.ResourceData, p return v } +func flattenSystemSdnConnectorNicIpPrivateIp(v interface{}, d *schema.ResourceData, pre string, sv string) interface{} { + return v +} + func flattenSystemSdnConnectorNicIpPublicIp(v interface{}, d *schema.ResourceData, pre string, sv string) interface{} { return v } @@ -2134,6 +2162,13 @@ func expandSystemSdnConnectorNic(d *schema.ResourceData, v interface{}, pre stri tmp["name"] = nil } + pre_append = pre + "." + strconv.Itoa(con) + "." + "peer_nic" + if _, ok := d.GetOk(pre_append); ok { + tmp["peer-nic"], _ = expandSystemSdnConnectorNicPeerNic(d, i["peer_nic"], pre_append, sv) + } else if d.HasChange(pre_append) { + tmp["peer-nic"] = nil + } + pre_append = pre + "." + strconv.Itoa(con) + "." + "ip" if _, ok := d.GetOk(pre_append); ok { tmp["ip"], _ = expandSystemSdnConnectorNicIp(d, i["ip"], pre_append, sv) @@ -2153,6 +2188,10 @@ func expandSystemSdnConnectorNicName(d *schema.ResourceData, v interface{}, pre return v, nil } +func expandSystemSdnConnectorNicPeerNic(d *schema.ResourceData, v interface{}, pre string, sv string) (interface{}, error) { + return v, nil +} + func expandSystemSdnConnectorNicIp(d *schema.ResourceData, v interface{}, pre string, sv string) (interface{}, error) { l := v.([]interface{}) result := make([]map[string]interface{}, 0, len(l)) @@ -2174,6 +2213,13 @@ func expandSystemSdnConnectorNicIp(d *schema.ResourceData, v interface{}, pre st tmp["name"] = nil } + pre_append = pre + "." + strconv.Itoa(con) + "." + "private_ip" + if _, ok := d.GetOk(pre_append); ok { + tmp["private-ip"], _ = expandSystemSdnConnectorNicIpPrivateIp(d, i["private_ip"], pre_append, sv) + } else if d.HasChange(pre_append) { + tmp["private-ip"] = nil + } + pre_append = pre + "." + strconv.Itoa(con) + "." + "public_ip" if _, ok := d.GetOk(pre_append); ok { tmp["public-ip"], _ = expandSystemSdnConnectorNicIpPublicIp(d, i["public_ip"], pre_append, sv) @@ -2200,6 +2246,10 @@ func expandSystemSdnConnectorNicIpName(d *schema.ResourceData, v interface{}, pr return v, nil } +func expandSystemSdnConnectorNicIpPrivateIp(d *schema.ResourceData, v interface{}, pre string, sv string) (interface{}, error) { + return v, nil +} + func expandSystemSdnConnectorNicIpPublicIp(d *schema.ResourceData, v interface{}, pre string, sv string) (interface{}, error) { return v, nil } diff --git a/fortios/resource_system_settings.go b/fortios/resource_system_settings.go index 4297ebfc8..517d12aa4 100644 --- a/fortios/resource_system_settings.go +++ b/fortios/resource_system_settings.go @@ -297,6 +297,11 @@ func resourceSystemSettings() *schema.Resource { Optional: true, Computed: true, }, + "ses_denied_multicast_traffic": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Computed: true, + }, "strict_src_check": &schema.Schema{ Type: schema.TypeString, Optional: true, @@ -1004,6 +1009,13 @@ func flattenSystemSettingsGateway(v interface{}, d *schema.ResourceData, pre str } func flattenSystemSettingsIp(v interface{}, d *schema.ResourceData, pre string, sv string) interface{} { + if v1, ok := d.GetOkExists(pre); ok && v != nil { + if s, ok := v1.(string); ok { + v = validateConvIPMask2CIDR(s, v.(string)) + return v + } + } + return v } @@ -1193,6 +1205,10 @@ func flattenSystemSettingsSesDeniedTraffic(v interface{}, d *schema.ResourceData return v } +func flattenSystemSettingsSesDeniedMulticastTraffic(v interface{}, d *schema.ResourceData, pre string, sv string) interface{} { + return v +} + func flattenSystemSettingsStrictSrcCheck(v interface{}, d *schema.ResourceData, pre string, sv string) interface{} { return v } @@ -1938,6 +1954,12 @@ func refreshObjectSystemSettings(d *schema.ResourceData, o map[string]interface{ } } + if err = d.Set("ses_denied_multicast_traffic", flattenSystemSettingsSesDeniedMulticastTraffic(o["ses-denied-multicast-traffic"], d, "ses_denied_multicast_traffic", sv)); err != nil { + if !fortiAPIPatch(o["ses-denied-multicast-traffic"]) { + return fmt.Errorf("Error reading ses_denied_multicast_traffic: %v", err) + } + } + if err = d.Set("strict_src_check", flattenSystemSettingsStrictSrcCheck(o["strict-src-check"], d, "strict_src_check", sv)); err != nil { if !fortiAPIPatch(o["strict-src-check"]) { return fmt.Errorf("Error reading strict_src_check: %v", err) @@ -2805,6 +2827,10 @@ func expandSystemSettingsSesDeniedTraffic(d *schema.ResourceData, v interface{}, return v, nil } +func expandSystemSettingsSesDeniedMulticastTraffic(d *schema.ResourceData, v interface{}, pre string, sv string) (interface{}, error) { + return v, nil +} + func expandSystemSettingsStrictSrcCheck(d *schema.ResourceData, v interface{}, pre string, sv string) (interface{}, error) { return v, nil } @@ -3913,6 +3939,19 @@ func getObjectSystemSettings(d *schema.ResourceData, setArgNil bool, sv string) } } + if v, ok := d.GetOk("ses_denied_multicast_traffic"); ok { + if setArgNil { + obj["ses-denied-multicast-traffic"] = nil + } else { + t, err := expandSystemSettingsSesDeniedMulticastTraffic(d, v, "ses_denied_multicast_traffic", sv) + if err != nil { + return &obj, err + } else if t != nil { + obj["ses-denied-multicast-traffic"] = t + } + } + } + if v, ok := d.GetOk("strict_src_check"); ok { if setArgNil { obj["strict-src-check"] = nil diff --git a/fortios/resource_system_speedtestserver.go b/fortios/resource_system_speedtestserver.go index 999a80b9c..0af9c2e85 100644 --- a/fortios/resource_system_speedtestserver.go +++ b/fortios/resource_system_speedtestserver.go @@ -55,6 +55,7 @@ func resourceSystemSpeedTestServer() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "ip": &schema.Schema{ Type: schema.TypeString, @@ -445,8 +446,6 @@ func expandSystemSpeedTestServerHost(d *schema.ResourceData, v interface{}, pre pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandSystemSpeedTestServerHostId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "ip" diff --git a/fortios/resource_system_standalonecluster.go b/fortios/resource_system_standalonecluster.go index f769da409..63a738aec 100644 --- a/fortios/resource_system_standalonecluster.go +++ b/fortios/resource_system_standalonecluster.go @@ -183,6 +183,7 @@ func resourceSystemStandaloneCluster() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "src_port_range": &schema.Schema{ Type: schema.TypeString, @@ -1185,8 +1186,6 @@ func expandSystemStandaloneClusterClusterPeerSessionSyncFilterCustomService(d *s pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandSystemStandaloneClusterClusterPeerSessionSyncFilterCustomServiceId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "src_port_range" diff --git a/fortios/resource_system_vneinterface.go b/fortios/resource_system_vneinterface.go index b8d99feab..cc06831de 100644 --- a/fortios/resource_system_vneinterface.go +++ b/fortios/resource_system_vneinterface.go @@ -268,6 +268,13 @@ func flattenSystemVneInterfaceAutoAsicOffload(v interface{}, d *schema.ResourceD } func flattenSystemVneInterfaceIpv4Address(v interface{}, d *schema.ResourceData, pre string, sv string) interface{} { + if v1, ok := d.GetOkExists(pre); ok && v != nil { + if s, ok := v1.(string); ok { + v = validateConvIPMask2CIDR(s, v.(string)) + return v + } + } + return v } diff --git a/fortios/resource_system_vnetunnel.go b/fortios/resource_system_vnetunnel.go index e950b4606..dc7aec95e 100644 --- a/fortios/resource_system_vnetunnel.go +++ b/fortios/resource_system_vnetunnel.go @@ -229,6 +229,13 @@ func flattenSystemVneTunnelAutoAsicOffload(v interface{}, d *schema.ResourceData } func flattenSystemVneTunnelIpv4Address(v interface{}, d *schema.ResourceData, pre string, sv string) interface{} { + if v1, ok := d.GetOkExists(pre); ok && v != nil { + if s, ok := v1.(string); ok { + v = validateConvIPMask2CIDR(s, v.(string)) + return v + } + } + return v } diff --git a/fortios/resource_systemdhcp_server.go b/fortios/resource_systemdhcp_server.go index 8079cd234..97e627df0 100644 --- a/fortios/resource_systemdhcp_server.go +++ b/fortios/resource_systemdhcp_server.go @@ -497,6 +497,7 @@ func resourceSystemDhcpServer() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "type": &schema.Schema{ Type: schema.TypeString, @@ -2754,8 +2755,6 @@ func expandSystemDhcpServerReservedAddress(d *schema.ResourceData, v interface{} pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandSystemDhcpServerReservedAddressId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "type" diff --git a/fortios/resource_systemsnmp_community.go b/fortios/resource_systemsnmp_community.go index 1245f6ce8..523be9510 100644 --- a/fortios/resource_systemsnmp_community.go +++ b/fortios/resource_systemsnmp_community.go @@ -59,6 +59,7 @@ func resourceSystemSnmpCommunity() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "source_ip": &schema.Schema{ Type: schema.TypeString, @@ -857,8 +858,6 @@ func expandSystemSnmpCommunityHosts(d *schema.ResourceData, v interface{}, pre s pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandSystemSnmpCommunityHostsId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "source_ip" diff --git a/fortios/resource_user_adgrp.go b/fortios/resource_user_adgrp.go index a97ef9f7c..bb8b77f70 100644 --- a/fortios/resource_user_adgrp.go +++ b/fortios/resource_user_adgrp.go @@ -55,6 +55,7 @@ func resourceUserAdgrp() *schema.Resource { "fosid": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, }, } @@ -320,8 +321,6 @@ func getObjectUserAdgrp(d *schema.ResourceData, sv string) (*map[string]interfac } else if t != nil { obj["id"] = t } - } else if d.HasChange("fosid") { - obj["id"] = nil } return &obj, nil diff --git a/fortios/resource_user_deviceaccesslist.go b/fortios/resource_user_deviceaccesslist.go index 0bc5e46a2..9383440e7 100644 --- a/fortios/resource_user_deviceaccesslist.go +++ b/fortios/resource_user_deviceaccesslist.go @@ -54,6 +54,7 @@ func resourceUserDeviceAccessList() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "device": &schema.Schema{ Type: schema.TypeString, @@ -371,8 +372,6 @@ func expandUserDeviceAccessListDeviceList(d *schema.ResourceData, v interface{}, pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandUserDeviceAccessListDeviceListId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "device" diff --git a/fortios/resource_user_group.go b/fortios/resource_user_group.go index 1e996dd6b..399ae8465 100644 --- a/fortios/resource_user_group.go +++ b/fortios/resource_user_group.go @@ -99,6 +99,7 @@ func resourceUserGroup() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "server_name": &schema.Schema{ Type: schema.TypeString, @@ -978,8 +979,6 @@ func expandUserGroupMatch(d *schema.ResourceData, v interface{}, pre string, sv pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandUserGroupMatchId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "server_name" diff --git a/fortios/resource_user_radius.go b/fortios/resource_user_radius.go index a98e295f7..6083301c4 100644 --- a/fortios/resource_user_radius.go +++ b/fortios/resource_user_radius.go @@ -354,6 +354,7 @@ func resourceUserRadius() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "status": &schema.Schema{ Type: schema.TypeString, @@ -1562,8 +1563,6 @@ func expandUserRadiusAccountingServer(d *schema.ResourceData, v interface{}, pre pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandUserRadiusAccountingServerId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "status" diff --git a/fortios/resource_user_securityexemptlist.go b/fortios/resource_user_securityexemptlist.go index bac6dbb68..7d7bbecac 100644 --- a/fortios/resource_user_securityexemptlist.go +++ b/fortios/resource_user_securityexemptlist.go @@ -56,6 +56,7 @@ func resourceUserSecurityExemptList() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "srcaddr": &schema.Schema{ Type: schema.TypeSet, @@ -586,8 +587,6 @@ func expandUserSecurityExemptListRule(d *schema.ResourceData, v interface{}, pre pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandUserSecurityExemptListRuleId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "srcaddr" diff --git a/fortios/resource_virtualpatch_profile.go b/fortios/resource_virtualpatch_profile.go index c90da994f..94a9bbf98 100644 --- a/fortios/resource_virtualpatch_profile.go +++ b/fortios/resource_virtualpatch_profile.go @@ -71,6 +71,7 @@ func resourceVirtualPatchProfile() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "status": &schema.Schema{ Type: schema.TypeString, @@ -536,8 +537,6 @@ func expandVirtualPatchProfileExemption(d *schema.ResourceData, v interface{}, p pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandVirtualPatchProfileExemptionId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "status" diff --git a/fortios/resource_vpn_kmipserver.go b/fortios/resource_vpn_kmipserver.go index a5114b43a..7980d0140 100644 --- a/fortios/resource_vpn_kmipserver.go +++ b/fortios/resource_vpn_kmipserver.go @@ -51,6 +51,7 @@ func resourceVpnKmipServer() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "status": &schema.Schema{ Type: schema.TypeString, @@ -480,8 +481,6 @@ func expandVpnKmipServerServerList(d *schema.ResourceData, v interface{}, pre st pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandVpnKmipServerServerListId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "status" diff --git a/fortios/resource_vpnssl_settings.go b/fortios/resource_vpnssl_settings.go index fad49aad5..00c8722e2 100644 --- a/fortios/resource_vpnssl_settings.go +++ b/fortios/resource_vpnssl_settings.go @@ -365,6 +365,7 @@ func resourceVpnSslSettings() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "source_interface": &schema.Schema{ Type: schema.TypeSet, @@ -2449,8 +2450,6 @@ func expandVpnSslSettingsAuthenticationRule(d *schema.ResourceData, v interface{ pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandVpnSslSettingsAuthenticationRuleId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "source_interface" diff --git a/fortios/resource_vpnsslweb_hostchecksoftware.go b/fortios/resource_vpnsslweb_hostchecksoftware.go index 82ccd6936..ea161866f 100644 --- a/fortios/resource_vpnsslweb_hostchecksoftware.go +++ b/fortios/resource_vpnsslweb_hostchecksoftware.go @@ -72,6 +72,7 @@ func resourceVpnSslWebHostCheckSoftware() *schema.Resource { Type: schema.TypeInt, ValidateFunc: validation.IntBetween(0, 65535), Optional: true, + Computed: true, }, "action": &schema.Schema{ Type: schema.TypeString, @@ -520,8 +521,6 @@ func expandVpnSslWebHostCheckSoftwareCheckItemList(d *schema.ResourceData, v int pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandVpnSslWebHostCheckSoftwareCheckItemListId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "action" diff --git a/fortios/resource_vpnsslweb_portal.go b/fortios/resource_vpnsslweb_portal.go index c8a15ca7f..e2edad509 100644 --- a/fortios/resource_vpnsslweb_portal.go +++ b/fortios/resource_vpnsslweb_portal.go @@ -718,6 +718,7 @@ func resourceVpnSslWebPortal() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "domains": &schema.Schema{ Type: schema.TypeString, @@ -3860,8 +3861,6 @@ func expandVpnSslWebPortalSplitDns(d *schema.ResourceData, v interface{}, pre st pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandVpnSslWebPortalSplitDnsId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "domains" diff --git a/fortios/resource_waf_profile.go b/fortios/resource_waf_profile.go index f1b967bf1..9deb8000e 100644 --- a/fortios/resource_waf_profile.go +++ b/fortios/resource_waf_profile.go @@ -68,6 +68,7 @@ func resourceWafProfile() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "status": &schema.Schema{ Type: schema.TypeString, @@ -100,6 +101,7 @@ func resourceWafProfile() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, }, }, @@ -112,6 +114,7 @@ func resourceWafProfile() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, }, }, @@ -627,6 +630,7 @@ func resourceWafProfile() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "pattern": &schema.Schema{ Type: schema.TypeString, @@ -748,6 +752,7 @@ func resourceWafProfile() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "pattern": &schema.Schema{ Type: schema.TypeString, @@ -833,6 +838,7 @@ func resourceWafProfile() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "address": &schema.Schema{ Type: schema.TypeString, @@ -862,6 +868,7 @@ func resourceWafProfile() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "srcaddr": &schema.Schema{ Type: schema.TypeString, @@ -3000,8 +3007,6 @@ func expandWafProfileSignatureMainClass(d *schema.ResourceData, v interface{}, p pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandWafProfileSignatureMainClassId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "status" @@ -4006,8 +4011,6 @@ func expandWafProfileConstraintException(d *schema.ResourceData, v interface{}, pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandWafProfileConstraintExceptionId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "pattern" @@ -4239,8 +4242,6 @@ func expandWafProfileMethodMethodPolicy(d *schema.ResourceData, v interface{}, p pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandWafProfileMethodMethodPolicyId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "pattern" @@ -4420,8 +4421,6 @@ func expandWafProfileUrlAccess(d *schema.ResourceData, v interface{}, pre string pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandWafProfileUrlAccessId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "address" @@ -4498,8 +4497,6 @@ func expandWafProfileUrlAccessAccessPattern(d *schema.ResourceData, v interface{ pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandWafProfileUrlAccessAccessPatternId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "srcaddr" diff --git a/fortios/resource_wanopt_contentdeliverynetworkrule.go b/fortios/resource_wanopt_contentdeliverynetworkrule.go index 50abdc03d..c2decc05e 100644 --- a/fortios/resource_wanopt_contentdeliverynetworkrule.go +++ b/fortios/resource_wanopt_contentdeliverynetworkrule.go @@ -123,6 +123,7 @@ func resourceWanoptContentDeliveryNetworkRule() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "target": &schema.Schema{ Type: schema.TypeString, @@ -153,6 +154,7 @@ func resourceWanoptContentDeliveryNetworkRule() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "target": &schema.Schema{ Type: schema.TypeString, @@ -1082,8 +1084,6 @@ func expandWanoptContentDeliveryNetworkRuleRulesMatchEntries(d *schema.ResourceD pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandWanoptContentDeliveryNetworkRuleRulesMatchEntriesId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "target" @@ -1159,8 +1159,6 @@ func expandWanoptContentDeliveryNetworkRuleRulesSkipEntries(d *schema.ResourceDa pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandWanoptContentDeliveryNetworkRuleRulesSkipEntriesId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "target" diff --git a/fortios/resource_webfilter_ftgdlocalcat.go b/fortios/resource_webfilter_ftgdlocalcat.go index cd5919192..b16c2d025 100644 --- a/fortios/resource_webfilter_ftgdlocalcat.go +++ b/fortios/resource_webfilter_ftgdlocalcat.go @@ -45,6 +45,7 @@ func resourceWebfilterFtgdLocalCat() *schema.Resource { Type: schema.TypeInt, ValidateFunc: validation.IntBetween(140, 191), Optional: true, + Computed: true, }, "desc": &schema.Schema{ Type: schema.TypeString, @@ -281,8 +282,6 @@ func getObjectWebfilterFtgdLocalCat(d *schema.ResourceData, sv string) (*map[str } else if t != nil { obj["id"] = t } - } else if d.HasChange("fosid") { - obj["id"] = nil } if v, ok := d.GetOk("desc"); ok { diff --git a/fortios/resource_webfilter_profile.go b/fortios/resource_webfilter_profile.go index f59038e4a..15aeabed1 100644 --- a/fortios/resource_webfilter_profile.go +++ b/fortios/resource_webfilter_profile.go @@ -309,6 +309,7 @@ func resourceWebfilterProfile() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "channel_id": &schema.Schema{ Type: schema.TypeString, @@ -353,6 +354,7 @@ func resourceWebfilterProfile() *schema.Resource { Type: schema.TypeInt, ValidateFunc: validation.IntBetween(0, 255), Optional: true, + Computed: true, }, "category": &schema.Schema{ Type: schema.TypeInt, @@ -413,6 +415,7 @@ func resourceWebfilterProfile() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "category": &schema.Schema{ Type: schema.TypeString, @@ -2987,8 +2990,6 @@ func expandWebfilterProfileYoutubeChannelFilter(d *schema.ResourceData, v interf pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandWebfilterProfileYoutubeChannelFilterId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "channel_id" @@ -3112,8 +3113,6 @@ func expandWebfilterProfileFtgdWfFilters(d *schema.ResourceData, v interface{}, pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandWebfilterProfileFtgdWfFiltersId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "category" @@ -3247,8 +3246,6 @@ func expandWebfilterProfileFtgdWfQuota(d *schema.ResourceData, v interface{}, pr pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandWebfilterProfileFtgdWfQuotaId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "category" diff --git a/fortios/resource_webproxy_global.go b/fortios/resource_webproxy_global.go index 577d093a9..cd1c90c20 100644 --- a/fortios/resource_webproxy_global.go +++ b/fortios/resource_webproxy_global.go @@ -101,7 +101,7 @@ func resourceWebProxyGlobal() *schema.Resource { }, "max_waf_body_cache_length": &schema.Schema{ Type: schema.TypeInt, - ValidateFunc: validation.IntBetween(10, 1024), + ValidateFunc: validation.IntBetween(1, 1024), Optional: true, Computed: true, }, @@ -183,6 +183,11 @@ func resourceWebProxyGlobal() *schema.Resource { Optional: true, Computed: true, }, + "request_obs_fold": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Computed: true, + }, "dynamic_sort_subtable": &schema.Schema{ Type: schema.TypeString, Optional: true, @@ -491,6 +496,10 @@ func flattenWebProxyGlobalProxyTransparentCertInspection(v interface{}, d *schem return v } +func flattenWebProxyGlobalRequestObsFold(v interface{}, d *schema.ResourceData, pre string, sv string) interface{} { + return v +} + func refreshObjectWebProxyGlobal(d *schema.ResourceData, o map[string]interface{}, sv string) error { var err error var b_get_all_tables bool @@ -676,6 +685,12 @@ func refreshObjectWebProxyGlobal(d *schema.ResourceData, o map[string]interface{ } } + if err = d.Set("request_obs_fold", flattenWebProxyGlobalRequestObsFold(o["request-obs-fold"], d, "request_obs_fold", sv)); err != nil { + if !fortiAPIPatch(o["request-obs-fold"]) { + return fmt.Errorf("Error reading request_obs_fold: %v", err) + } + } + return nil } @@ -837,6 +852,10 @@ func expandWebProxyGlobalProxyTransparentCertInspection(d *schema.ResourceData, return v, nil } +func expandWebProxyGlobalRequestObsFold(d *schema.ResourceData, v interface{}, pre string, sv string) (interface{}, error) { + return v, nil +} + func getObjectWebProxyGlobal(d *schema.ResourceData, setArgNil bool, sv string) (*map[string]interface{}, error) { obj := make(map[string]interface{}) @@ -1190,5 +1209,18 @@ func getObjectWebProxyGlobal(d *schema.ResourceData, setArgNil bool, sv string) } } + if v, ok := d.GetOk("request_obs_fold"); ok { + if setArgNil { + obj["request-obs-fold"] = nil + } else { + t, err := expandWebProxyGlobalRequestObsFold(d, v, "request_obs_fold", sv) + if err != nil { + return &obj, err + } else if t != nil { + obj["request-obs-fold"] = t + } + } + } + return &obj, nil } diff --git a/fortios/resource_webproxy_profile.go b/fortios/resource_webproxy_profile.go index 2ba9d1d6c..55471c7cf 100644 --- a/fortios/resource_webproxy_profile.go +++ b/fortios/resource_webproxy_profile.go @@ -101,6 +101,7 @@ func resourceWebProxyProfile() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "name": &schema.Schema{ Type: schema.TypeString, @@ -721,8 +722,6 @@ func expandWebProxyProfileHeaders(d *schema.ResourceData, v interface{}, pre str pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandWebProxyProfileHeadersId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "name" diff --git a/fortios/resource_wirelesscontroller_apcfgprofile.go b/fortios/resource_wirelesscontroller_apcfgprofile.go index 381ed0ba7..302a201b7 100644 --- a/fortios/resource_wirelesscontroller_apcfgprofile.go +++ b/fortios/resource_wirelesscontroller_apcfgprofile.go @@ -84,6 +84,7 @@ func resourceWirelessControllerApcfgProfile() *schema.Resource { Type: schema.TypeInt, ValidateFunc: validation.IntBetween(1, 255), Optional: true, + Computed: true, }, "type": &schema.Schema{ Type: schema.TypeString, @@ -500,8 +501,6 @@ func expandWirelessControllerApcfgProfileCommandList(d *schema.ResourceData, v i pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandWirelessControllerApcfgProfileCommandListId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "type" diff --git a/fortios/resource_wirelesscontroller_intercontroller.go b/fortios/resource_wirelesscontroller_intercontroller.go index ec92ba517..a673cee39 100644 --- a/fortios/resource_wirelesscontroller_intercontroller.go +++ b/fortios/resource_wirelesscontroller_intercontroller.go @@ -77,6 +77,7 @@ func resourceWirelessControllerInterController() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "peer_ip": &schema.Schema{ Type: schema.TypeString, @@ -419,8 +420,6 @@ func expandWirelessControllerInterControllerInterControllerPeer(d *schema.Resour pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandWirelessControllerInterControllerInterControllerPeerId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "peer_ip" diff --git a/fortios/resource_wirelesscontroller_qosprofile.go b/fortios/resource_wirelesscontroller_qosprofile.go index 0c54d446e..d1a6b35af 100644 --- a/fortios/resource_wirelesscontroller_qosprofile.go +++ b/fortios/resource_wirelesscontroller_qosprofile.go @@ -119,6 +119,7 @@ func resourceWirelessControllerQosProfile() *schema.Resource { Type: schema.TypeInt, ValidateFunc: validation.IntBetween(0, 63), Optional: true, + Computed: true, }, }, }, @@ -132,6 +133,7 @@ func resourceWirelessControllerQosProfile() *schema.Resource { Type: schema.TypeInt, ValidateFunc: validation.IntBetween(0, 63), Optional: true, + Computed: true, }, }, }, @@ -145,6 +147,7 @@ func resourceWirelessControllerQosProfile() *schema.Resource { Type: schema.TypeInt, ValidateFunc: validation.IntBetween(0, 63), Optional: true, + Computed: true, }, }, }, @@ -158,6 +161,7 @@ func resourceWirelessControllerQosProfile() *schema.Resource { Type: schema.TypeInt, ValidateFunc: validation.IntBetween(0, 63), Optional: true, + Computed: true, }, }, }, diff --git a/fortios/resource_wirelesscontroller_setting.go b/fortios/resource_wirelesscontroller_setting.go index 4f1169c49..97d057e04 100644 --- a/fortios/resource_wirelesscontroller_setting.go +++ b/fortios/resource_wirelesscontroller_setting.go @@ -80,6 +80,7 @@ func resourceWirelessControllerSetting() *schema.Resource { Type: schema.TypeInt, ValidateFunc: validation.IntBetween(0, 65535), Optional: true, + Computed: true, }, "ssid_pattern": &schema.Schema{ Type: schema.TypeString, @@ -596,8 +597,6 @@ func expandWirelessControllerSettingOffendingSsid(d *schema.ResourceData, v inte pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandWirelessControllerSettingOffendingSsidId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "ssid_pattern" diff --git a/fortios/resource_wirelesscontroller_vap.go b/fortios/resource_wirelesscontroller_vap.go index 766087efe..20e116c30 100644 --- a/fortios/resource_wirelesscontroller_vap.go +++ b/fortios/resource_wirelesscontroller_vap.go @@ -805,6 +805,7 @@ func resourceWirelessControllerVap() *schema.Resource { Type: schema.TypeInt, ValidateFunc: validation.IntBetween(0, 4094), Optional: true, + Computed: true, }, "wtp_group": &schema.Schema{ Type: schema.TypeString, @@ -1034,6 +1035,7 @@ func resourceWirelessControllerVap() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "mac": &schema.Schema{ Type: schema.TypeString, @@ -1583,6 +1585,13 @@ func flattenWirelessControllerVapLocalStandaloneNat(v interface{}, d *schema.Res } func flattenWirelessControllerVapIp(v interface{}, d *schema.ResourceData, pre string, sv string) interface{} { + if v1, ok := d.GetOkExists(pre); ok && v != nil { + if s, ok := v1.(string); ok { + v = validateConvIPMask2CIDR(s, v.(string)) + return v + } + } + return v } @@ -4438,8 +4447,6 @@ func expandWirelessControllerVapVlanPool(d *schema.ResourceData, v interface{}, pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandWirelessControllerVapVlanPoolId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "wtp_group" @@ -4654,8 +4661,6 @@ func expandWirelessControllerVapMacFilterList(d *schema.ResourceData, v interfac pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandWirelessControllerVapMacFilterListId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "mac" diff --git a/fortios/resource_wirelesscontroller_wtp.go b/fortios/resource_wirelesscontroller_wtp.go index ca3f3f2c9..0117e08d6 100644 --- a/fortios/resource_wirelesscontroller_wtp.go +++ b/fortios/resource_wirelesscontroller_wtp.go @@ -186,6 +186,7 @@ func resourceWirelessControllerWtp() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "dest_ip": &schema.Schema{ Type: schema.TypeString, @@ -2895,8 +2896,6 @@ func expandWirelessControllerWtpSplitTunnelingAcl(d *schema.ResourceData, v inte pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandWirelessControllerWtpSplitTunnelingAclId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "dest_ip" diff --git a/fortios/resource_wirelesscontroller_wtpprofile.go b/fortios/resource_wirelesscontroller_wtpprofile.go index 05f24b78a..e7358e1a5 100644 --- a/fortios/resource_wirelesscontroller_wtpprofile.go +++ b/fortios/resource_wirelesscontroller_wtpprofile.go @@ -274,6 +274,7 @@ func resourceWirelessControllerWtpProfile() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "mac": &schema.Schema{ Type: schema.TypeString, @@ -321,6 +322,7 @@ func resourceWirelessControllerWtpProfile() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "dest_ip": &schema.Schema{ Type: schema.TypeString, @@ -2293,6 +2295,74 @@ func resourceWirelessControllerWtpProfile() *schema.Resource { Optional: true, Computed: true, }, + "ble_rtls": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "ble_rtls_protocol": &schema.Schema{ + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "ble_rtls_server_fqdn": &schema.Schema{ + Type: schema.TypeString, + ValidateFunc: validation.StringLenBetween(0, 255), + Optional: true, + }, + "ble_rtls_server_path": &schema.Schema{ + Type: schema.TypeString, + ValidateFunc: validation.StringLenBetween(0, 255), + Optional: true, + }, + "ble_rtls_server_token": &schema.Schema{ + Type: schema.TypeString, + ValidateFunc: validation.StringLenBetween(0, 31), + Optional: true, + }, + "ble_rtls_server_port": &schema.Schema{ + Type: schema.TypeInt, + ValidateFunc: validation.IntBetween(1, 65535), + Optional: true, + Computed: true, + }, + "ble_rtls_accumulation_interval": &schema.Schema{ + Type: schema.TypeInt, + ValidateFunc: validation.IntBetween(1, 60), + Optional: true, + Computed: true, + }, + "ble_rtls_reporting_interval": &schema.Schema{ + Type: schema.TypeInt, + ValidateFunc: validation.IntBetween(1, 600), + Optional: true, + Computed: true, + }, + "ble_rtls_asset_uuid_list1": &schema.Schema{ + Type: schema.TypeString, + ValidateFunc: validation.StringLenBetween(0, 36), + Optional: true, + }, + "ble_rtls_asset_uuid_list2": &schema.Schema{ + Type: schema.TypeString, + ValidateFunc: validation.StringLenBetween(0, 36), + Optional: true, + }, + "ble_rtls_asset_uuid_list3": &schema.Schema{ + Type: schema.TypeString, + ValidateFunc: validation.StringLenBetween(0, 36), + Optional: true, + }, + "ble_rtls_asset_uuid_list4": &schema.Schema{ + Type: schema.TypeString, + ValidateFunc: validation.StringLenBetween(0, 36), + Optional: true, + }, + "ble_rtls_asset_addrgrp_list": &schema.Schema{ + Type: schema.TypeString, + ValidateFunc: validation.StringLenBetween(0, 79), + Optional: true, + }, "polestar": &schema.Schema{ Type: schema.TypeString, Optional: true, @@ -6588,6 +6658,71 @@ func flattenWirelessControllerWtpProfileLbs(v interface{}, d *schema.ResourceDat result["station_locate"] = flattenWirelessControllerWtpProfileLbsStationLocate(i["station-locate"], d, pre_append, sv) } + pre_append = pre + ".0." + "ble_rtls" + if _, ok := i["ble-rtls"]; ok { + result["ble_rtls"] = flattenWirelessControllerWtpProfileLbsBleRtls(i["ble-rtls"], d, pre_append, sv) + } + + pre_append = pre + ".0." + "ble_rtls_protocol" + if _, ok := i["ble-rtls-protocol"]; ok { + result["ble_rtls_protocol"] = flattenWirelessControllerWtpProfileLbsBleRtlsProtocol(i["ble-rtls-protocol"], d, pre_append, sv) + } + + pre_append = pre + ".0." + "ble_rtls_server_fqdn" + if _, ok := i["ble-rtls-server-fqdn"]; ok { + result["ble_rtls_server_fqdn"] = flattenWirelessControllerWtpProfileLbsBleRtlsServerFqdn(i["ble-rtls-server-fqdn"], d, pre_append, sv) + } + + pre_append = pre + ".0." + "ble_rtls_server_path" + if _, ok := i["ble-rtls-server-path"]; ok { + result["ble_rtls_server_path"] = flattenWirelessControllerWtpProfileLbsBleRtlsServerPath(i["ble-rtls-server-path"], d, pre_append, sv) + } + + pre_append = pre + ".0." + "ble_rtls_server_token" + if _, ok := i["ble-rtls-server-token"]; ok { + result["ble_rtls_server_token"] = flattenWirelessControllerWtpProfileLbsBleRtlsServerToken(i["ble-rtls-server-token"], d, pre_append, sv) + } + + pre_append = pre + ".0." + "ble_rtls_server_port" + if _, ok := i["ble-rtls-server-port"]; ok { + result["ble_rtls_server_port"] = flattenWirelessControllerWtpProfileLbsBleRtlsServerPort(i["ble-rtls-server-port"], d, pre_append, sv) + } + + pre_append = pre + ".0." + "ble_rtls_accumulation_interval" + if _, ok := i["ble-rtls-accumulation-interval"]; ok { + result["ble_rtls_accumulation_interval"] = flattenWirelessControllerWtpProfileLbsBleRtlsAccumulationInterval(i["ble-rtls-accumulation-interval"], d, pre_append, sv) + } + + pre_append = pre + ".0." + "ble_rtls_reporting_interval" + if _, ok := i["ble-rtls-reporting-interval"]; ok { + result["ble_rtls_reporting_interval"] = flattenWirelessControllerWtpProfileLbsBleRtlsReportingInterval(i["ble-rtls-reporting-interval"], d, pre_append, sv) + } + + pre_append = pre + ".0." + "ble_rtls_asset_uuid_list1" + if _, ok := i["ble-rtls-asset-uuid-list1"]; ok { + result["ble_rtls_asset_uuid_list1"] = flattenWirelessControllerWtpProfileLbsBleRtlsAssetUuidList1(i["ble-rtls-asset-uuid-list1"], d, pre_append, sv) + } + + pre_append = pre + ".0." + "ble_rtls_asset_uuid_list2" + if _, ok := i["ble-rtls-asset-uuid-list2"]; ok { + result["ble_rtls_asset_uuid_list2"] = flattenWirelessControllerWtpProfileLbsBleRtlsAssetUuidList2(i["ble-rtls-asset-uuid-list2"], d, pre_append, sv) + } + + pre_append = pre + ".0." + "ble_rtls_asset_uuid_list3" + if _, ok := i["ble-rtls-asset-uuid-list3"]; ok { + result["ble_rtls_asset_uuid_list3"] = flattenWirelessControllerWtpProfileLbsBleRtlsAssetUuidList3(i["ble-rtls-asset-uuid-list3"], d, pre_append, sv) + } + + pre_append = pre + ".0." + "ble_rtls_asset_uuid_list4" + if _, ok := i["ble-rtls-asset-uuid-list4"]; ok { + result["ble_rtls_asset_uuid_list4"] = flattenWirelessControllerWtpProfileLbsBleRtlsAssetUuidList4(i["ble-rtls-asset-uuid-list4"], d, pre_append, sv) + } + + pre_append = pre + ".0." + "ble_rtls_asset_addrgrp_list" + if _, ok := i["ble-rtls-asset-addrgrp-list"]; ok { + result["ble_rtls_asset_addrgrp_list"] = flattenWirelessControllerWtpProfileLbsBleRtlsAssetAddrgrpList(i["ble-rtls-asset-addrgrp-list"], d, pre_append, sv) + } + pre_append = pre + ".0." + "polestar" if _, ok := i["polestar"]; ok { result["polestar"] = flattenWirelessControllerWtpProfileLbsPolestar(i["polestar"], d, pre_append, sv) @@ -6749,6 +6884,58 @@ func flattenWirelessControllerWtpProfileLbsStationLocate(v interface{}, d *schem return v } +func flattenWirelessControllerWtpProfileLbsBleRtls(v interface{}, d *schema.ResourceData, pre string, sv string) interface{} { + return v +} + +func flattenWirelessControllerWtpProfileLbsBleRtlsProtocol(v interface{}, d *schema.ResourceData, pre string, sv string) interface{} { + return v +} + +func flattenWirelessControllerWtpProfileLbsBleRtlsServerFqdn(v interface{}, d *schema.ResourceData, pre string, sv string) interface{} { + return v +} + +func flattenWirelessControllerWtpProfileLbsBleRtlsServerPath(v interface{}, d *schema.ResourceData, pre string, sv string) interface{} { + return v +} + +func flattenWirelessControllerWtpProfileLbsBleRtlsServerToken(v interface{}, d *schema.ResourceData, pre string, sv string) interface{} { + return v +} + +func flattenWirelessControllerWtpProfileLbsBleRtlsServerPort(v interface{}, d *schema.ResourceData, pre string, sv string) interface{} { + return convintf2i(v) +} + +func flattenWirelessControllerWtpProfileLbsBleRtlsAccumulationInterval(v interface{}, d *schema.ResourceData, pre string, sv string) interface{} { + return convintf2i(v) +} + +func flattenWirelessControllerWtpProfileLbsBleRtlsReportingInterval(v interface{}, d *schema.ResourceData, pre string, sv string) interface{} { + return convintf2i(v) +} + +func flattenWirelessControllerWtpProfileLbsBleRtlsAssetUuidList1(v interface{}, d *schema.ResourceData, pre string, sv string) interface{} { + return v +} + +func flattenWirelessControllerWtpProfileLbsBleRtlsAssetUuidList2(v interface{}, d *schema.ResourceData, pre string, sv string) interface{} { + return v +} + +func flattenWirelessControllerWtpProfileLbsBleRtlsAssetUuidList3(v interface{}, d *schema.ResourceData, pre string, sv string) interface{} { + return v +} + +func flattenWirelessControllerWtpProfileLbsBleRtlsAssetUuidList4(v interface{}, d *schema.ResourceData, pre string, sv string) interface{} { + return v +} + +func flattenWirelessControllerWtpProfileLbsBleRtlsAssetAddrgrpList(v interface{}, d *schema.ResourceData, pre string, sv string) interface{} { + return v +} + func flattenWirelessControllerWtpProfileLbsPolestar(v interface{}, d *schema.ResourceData, pre string, sv string) interface{} { return v } @@ -7682,8 +7869,6 @@ func expandWirelessControllerWtpProfileDenyMacList(d *schema.ResourceData, v int pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandWirelessControllerWtpProfileDenyMacListId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "mac" @@ -7748,8 +7933,6 @@ func expandWirelessControllerWtpProfileSplitTunnelingAcl(d *schema.ResourceData, pre_append = pre + "." + strconv.Itoa(con) + "." + "id" if _, ok := d.GetOk(pre_append); ok { tmp["id"], _ = expandWirelessControllerWtpProfileSplitTunnelingAclId(d, i["id"], pre_append, sv) - } else if d.HasChange(pre_append) { - tmp["id"] = nil } pre_append = pre + "." + strconv.Itoa(con) + "." + "dest_ip" @@ -10815,6 +10998,58 @@ func expandWirelessControllerWtpProfileLbs(d *schema.ResourceData, v interface{} if _, ok := d.GetOk(pre_append); ok { result["station-locate"], _ = expandWirelessControllerWtpProfileLbsStationLocate(d, i["station_locate"], pre_append, sv) } + pre_append = pre + ".0." + "ble_rtls" + if _, ok := d.GetOk(pre_append); ok { + result["ble-rtls"], _ = expandWirelessControllerWtpProfileLbsBleRtls(d, i["ble_rtls"], pre_append, sv) + } + pre_append = pre + ".0." + "ble_rtls_protocol" + if _, ok := d.GetOk(pre_append); ok { + result["ble-rtls-protocol"], _ = expandWirelessControllerWtpProfileLbsBleRtlsProtocol(d, i["ble_rtls_protocol"], pre_append, sv) + } + pre_append = pre + ".0." + "ble_rtls_server_fqdn" + if _, ok := d.GetOk(pre_append); ok { + result["ble-rtls-server-fqdn"], _ = expandWirelessControllerWtpProfileLbsBleRtlsServerFqdn(d, i["ble_rtls_server_fqdn"], pre_append, sv) + } + pre_append = pre + ".0." + "ble_rtls_server_path" + if _, ok := d.GetOk(pre_append); ok { + result["ble-rtls-server-path"], _ = expandWirelessControllerWtpProfileLbsBleRtlsServerPath(d, i["ble_rtls_server_path"], pre_append, sv) + } + pre_append = pre + ".0." + "ble_rtls_server_token" + if _, ok := d.GetOk(pre_append); ok { + result["ble-rtls-server-token"], _ = expandWirelessControllerWtpProfileLbsBleRtlsServerToken(d, i["ble_rtls_server_token"], pre_append, sv) + } + pre_append = pre + ".0." + "ble_rtls_server_port" + if _, ok := d.GetOk(pre_append); ok { + result["ble-rtls-server-port"], _ = expandWirelessControllerWtpProfileLbsBleRtlsServerPort(d, i["ble_rtls_server_port"], pre_append, sv) + } + pre_append = pre + ".0." + "ble_rtls_accumulation_interval" + if _, ok := d.GetOk(pre_append); ok { + result["ble-rtls-accumulation-interval"], _ = expandWirelessControllerWtpProfileLbsBleRtlsAccumulationInterval(d, i["ble_rtls_accumulation_interval"], pre_append, sv) + } + pre_append = pre + ".0." + "ble_rtls_reporting_interval" + if _, ok := d.GetOk(pre_append); ok { + result["ble-rtls-reporting-interval"], _ = expandWirelessControllerWtpProfileLbsBleRtlsReportingInterval(d, i["ble_rtls_reporting_interval"], pre_append, sv) + } + pre_append = pre + ".0." + "ble_rtls_asset_uuid_list1" + if _, ok := d.GetOk(pre_append); ok { + result["ble-rtls-asset-uuid-list1"], _ = expandWirelessControllerWtpProfileLbsBleRtlsAssetUuidList1(d, i["ble_rtls_asset_uuid_list1"], pre_append, sv) + } + pre_append = pre + ".0." + "ble_rtls_asset_uuid_list2" + if _, ok := d.GetOk(pre_append); ok { + result["ble-rtls-asset-uuid-list2"], _ = expandWirelessControllerWtpProfileLbsBleRtlsAssetUuidList2(d, i["ble_rtls_asset_uuid_list2"], pre_append, sv) + } + pre_append = pre + ".0." + "ble_rtls_asset_uuid_list3" + if _, ok := d.GetOk(pre_append); ok { + result["ble-rtls-asset-uuid-list3"], _ = expandWirelessControllerWtpProfileLbsBleRtlsAssetUuidList3(d, i["ble_rtls_asset_uuid_list3"], pre_append, sv) + } + pre_append = pre + ".0." + "ble_rtls_asset_uuid_list4" + if _, ok := d.GetOk(pre_append); ok { + result["ble-rtls-asset-uuid-list4"], _ = expandWirelessControllerWtpProfileLbsBleRtlsAssetUuidList4(d, i["ble_rtls_asset_uuid_list4"], pre_append, sv) + } + pre_append = pre + ".0." + "ble_rtls_asset_addrgrp_list" + if _, ok := d.GetOk(pre_append); ok { + result["ble-rtls-asset-addrgrp-list"], _ = expandWirelessControllerWtpProfileLbsBleRtlsAssetAddrgrpList(d, i["ble_rtls_asset_addrgrp_list"], pre_append, sv) + } pre_append = pre + ".0." + "polestar" if _, ok := d.GetOk(pre_append); ok { result["polestar"], _ = expandWirelessControllerWtpProfileLbsPolestar(d, i["polestar"], pre_append, sv) @@ -10967,6 +11202,58 @@ func expandWirelessControllerWtpProfileLbsStationLocate(d *schema.ResourceData, return v, nil } +func expandWirelessControllerWtpProfileLbsBleRtls(d *schema.ResourceData, v interface{}, pre string, sv string) (interface{}, error) { + return v, nil +} + +func expandWirelessControllerWtpProfileLbsBleRtlsProtocol(d *schema.ResourceData, v interface{}, pre string, sv string) (interface{}, error) { + return v, nil +} + +func expandWirelessControllerWtpProfileLbsBleRtlsServerFqdn(d *schema.ResourceData, v interface{}, pre string, sv string) (interface{}, error) { + return v, nil +} + +func expandWirelessControllerWtpProfileLbsBleRtlsServerPath(d *schema.ResourceData, v interface{}, pre string, sv string) (interface{}, error) { + return v, nil +} + +func expandWirelessControllerWtpProfileLbsBleRtlsServerToken(d *schema.ResourceData, v interface{}, pre string, sv string) (interface{}, error) { + return v, nil +} + +func expandWirelessControllerWtpProfileLbsBleRtlsServerPort(d *schema.ResourceData, v interface{}, pre string, sv string) (interface{}, error) { + return v, nil +} + +func expandWirelessControllerWtpProfileLbsBleRtlsAccumulationInterval(d *schema.ResourceData, v interface{}, pre string, sv string) (interface{}, error) { + return v, nil +} + +func expandWirelessControllerWtpProfileLbsBleRtlsReportingInterval(d *schema.ResourceData, v interface{}, pre string, sv string) (interface{}, error) { + return v, nil +} + +func expandWirelessControllerWtpProfileLbsBleRtlsAssetUuidList1(d *schema.ResourceData, v interface{}, pre string, sv string) (interface{}, error) { + return v, nil +} + +func expandWirelessControllerWtpProfileLbsBleRtlsAssetUuidList2(d *schema.ResourceData, v interface{}, pre string, sv string) (interface{}, error) { + return v, nil +} + +func expandWirelessControllerWtpProfileLbsBleRtlsAssetUuidList3(d *schema.ResourceData, v interface{}, pre string, sv string) (interface{}, error) { + return v, nil +} + +func expandWirelessControllerWtpProfileLbsBleRtlsAssetUuidList4(d *schema.ResourceData, v interface{}, pre string, sv string) (interface{}, error) { + return v, nil +} + +func expandWirelessControllerWtpProfileLbsBleRtlsAssetAddrgrpList(d *schema.ResourceData, v interface{}, pre string, sv string) (interface{}, error) { + return v, nil +} + func expandWirelessControllerWtpProfileLbsPolestar(d *schema.ResourceData, v interface{}, pre string, sv string) (interface{}, error) { return v, nil } diff --git a/sdk/request/request.go b/sdk/request/request.go index 2958ef2b6..738850206 100644 --- a/sdk/request/request.go +++ b/sdk/request/request.go @@ -88,11 +88,14 @@ func (r *Request) Send2(retries int, ignvdom bool) error { r.HTTPRequest.Header.Set("Content-Type", "application/json") r.HTTPRequest.Header.Set("accept", "application/json") + if token != "" { + r.HTTPRequest.Header.Set("Authorization", "Bearer "+token) + } vdom := r.Config.Auth.Vdom if ignvdom == true { vdom = "" } - u := r.buildURL(vdom, token) + u := r.buildURL(vdom, "") r.HTTPRequest.URL, err = url.Parse(u) if err != nil { @@ -166,11 +169,14 @@ func (r *Request) Send3(vdomparam string) error { } } r.HTTPRequest.Header.Set("Content-Type", "application/json") + if token != "" { + r.HTTPRequest.Header.Set("Authorization", "Bearer "+token) + } vdom := vdomparam if vdom == "" { vdom = r.Config.Auth.Vdom } - u := r.buildURL(vdom, token) + u := r.buildURL(vdom, "") r.HTTPRequest.URL, err = url.Parse(u) if err != nil { return err @@ -244,7 +250,6 @@ func (r *Request) CheckValid() error { } return nil } - log.Printf("token: %v", token) // logout token errLogout := r.LogoutToken(token) if errLogout != nil { @@ -287,14 +292,14 @@ func (r *Request) CheckValid() error { return err } -func filterapikey(v string) string { +func filterapikey(v string) string { // !!! need check whether need this or not re, _ := regexp.Compile("access_token=.*?\"") res := re.ReplaceAllString(v, "access_token=***************\"") return res } -func (r *Request) buildURL(vdom, token string) string { +func (r *Request) buildURL(vdom, spvar string) string { u := "https://" u += r.Config.FwTarget u += r.Path @@ -307,9 +312,8 @@ func (r *Request) buildURL(vdom, token string) string { param_list = append(param_list, "vdom="+vdom) } } - - if token != "" { - param_list = append(param_list, "access_token="+token) + if spvar != "" { + param_list = append(param_list, spvar) } if len(param_list) > 0 { @@ -341,16 +345,14 @@ func (r *Request) SendWithSpecialParams(s, vdomparam string) error { } } r.HTTPRequest.Header.Set("Content-Type", "application/json") + if token != "" { + r.HTTPRequest.Header.Set("Authorization", "Bearer "+token) + } vdom := vdomparam if vdom == "" { vdom = r.Config.Auth.Vdom } - u := r.buildURL(vdom, token) - - if s != "" { - u += "&" - u += s - } + u := r.buildURL(vdom, s) r.HTTPRequest.URL, err = url.Parse(u) if err != nil { @@ -592,11 +594,10 @@ func (r *Request) LogoutToken(token string) error { req, _ := http.NewRequest("DELETE", "", bodyBytes) req.Header.Set("Content-Type", "application/json") + req.Header.Set("Authorization", "Bearer "+token) // !!! check whether logout or not u := "https://" u += r.Config.FwTarget u += "/api/v2/authentication" - u += "?access_token=" - u += token req.URL, err = url.Parse(u) if err != nil { err = fmt.Errorf("Could not parse URL: %s", err) diff --git a/test/lint_check.sh b/test/lint_check.sh deleted file mode 100644 index ec1f9f672..000000000 --- a/test/lint_check.sh +++ /dev/null @@ -1,10 +0,0 @@ -p=$(dirname "$PWD"); -export GOPATH=${p%/*/*/*/*}"/" -make -C ../ fmt -golint ../fortios -golint ../vendor/github.com/fortinetdev/forti-sdk-go/fortios/auth -golint ../vendor/github.com/fortinetdev/forti-sdk-go/fortios/config -golint ../vendor/github.com/fortinetdev/forti-sdk-go/fortios/request -golint ../vendor/github.com/fortinetdev/forti-sdk-go/fortios/sdkcore -make -C ../ build - diff --git a/test/test.sh b/test/test.sh deleted file mode 100644 index 5769eb510..000000000 --- a/test/test.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -read -p "Please input FORTIOS_ACCESS_HOSTNAME:" host -read -p "Please input FORTIOS_ACCESS_TOKEN:" token -read -p "Please input FORTIOS_INSECURE:" insecure -read -p "Please input FORTIOS_CA_CABUNDLE:" cabundlefile - -p=$(dirname "$PWD"); -export GOPATH=${p%/*/*/*/*}"/" -export "FORTIOS_ACCESS_HOSTNAME"=$host -export "FORTIOS_ACCESS_TOKEN"=$token -export "FORTIOS_INSECURE"=$insecure -export "FORTIOS_CA_CABUNDLE"=$cabundlefile - -echo $FORTIOS_ACCESS_HOSTNAME -echo $FORTIOS_ACCESS_TOKEN -echo $FORTIOS_INSECURE -echo $FORTIOS_CA_CABUNDLE - -make -C ../ testacc diff --git a/website/docs/d/fortios_firewall_address6.html.markdown b/website/docs/d/fortios_firewall_address6.html.markdown index f1a26c4bc..e1c4aa232 100644 --- a/website/docs/d/fortios_firewall_address6.html.markdown +++ b/website/docs/d/fortios_firewall_address6.html.markdown @@ -46,6 +46,8 @@ The following attributes are exported: * `tenant` - Tenant. * `epg_name` - Endpoint group name. * `sdn_tag` - SDN Tag. +* `filter` - Match criteria filter. +* `sdn_addr_type` - Type of addresses to collect. * `fabric_object` - Security Fabric global object setting. The `macaddr` block contains: diff --git a/website/docs/d/fortios_system_global.html.markdown b/website/docs/d/fortios_system_global.html.markdown index 7cc7088c3..cfec41349 100644 --- a/website/docs/d/fortios_system_global.html.markdown +++ b/website/docs/d/fortios_system_global.html.markdown @@ -266,6 +266,7 @@ The following attributes are exported: * `log_uuid_address` - Enable/disable insertion of address UUIDs to traffic logs. * `log_ssl_connection` - Enable/disable logging of SSL connection events. * `gui_rest_api_cache` - Enable/disable REST API result caching on FortiGate. +* `rest_api_key_url_query` - Enable/disable support for passing REST API keys through URL query parameters. * `gui_cdn_domain_override` - Domain of CDN server. * `gui_fortiguard_resource_fetch` - Enable/disable retrieving static GUI resources from FortiGuard. Disabling it will improve GUI load time for air-gapped environments. * `arp_max_entry` - Maximum number of dynamically learned MAC addresses that can be added to the ARP table (131072 - 2147483647, default = 131072). diff --git a/website/docs/d/fortios_system_sdnconnector.html.markdown b/website/docs/d/fortios_system_sdnconnector.html.markdown index 03178d668..ee8d97f1d 100644 --- a/website/docs/d/fortios_system_sdnconnector.html.markdown +++ b/website/docs/d/fortios_system_sdnconnector.html.markdown @@ -95,11 +95,13 @@ The `region_list` block contains: The `nic` block contains: * `name` - Network interface name. +* `peer_nic` - Peer network interface name. * `ip` - Configure IP configuration. The structure of `ip` block is documented below. The `ip` block contains: * `name` - IP configuration name. +* `private_ip` - Private IP address. * `public_ip` - Public IP name. * `resource_group` - Resource group of Azure public IP. diff --git a/website/docs/r/fortios_alertemail_setting.html.markdown b/website/docs/r/fortios_alertemail_setting.html.markdown index 4ae3f8889..f634f67b4 100644 --- a/website/docs/r/fortios_alertemail_setting.html.markdown +++ b/website/docs/r/fortios_alertemail_setting.html.markdown @@ -57,7 +57,7 @@ The following arguments are supported: * `fips_cc_errors` - Enable/disable FIPS and Common Criteria error logs in alert email. Valid values: `enable`, `disable`. * `fsso_disconnect_logs` - Enable/disable logging of FSSO collector agent disconnect. Valid values: `enable`, `disable`. * `ssh_logs` - Enable/disable SSH logs in alert email. Valid values: `enable`, `disable`. -* `fds_license_expiring_days` - Number of days to send alert email prior to FortiGuard license expiration (1 - 100 days). On FortiOS versions 6.2.0-7.2.0: default = 100. On FortiOS versions 7.2.1-7.2.9: default = 15. +* `fds_license_expiring_days` - Number of days to send alert email prior to FortiGuard license expiration (1 - 100 days). On FortiOS versions 6.2.0-7.2.0: default = 100. On FortiOS versions 7.2.1-7.2.10: default = 15. * `local_disk_usage` - Disk usage percentage at which to send alert email (1 - 99 percent, default = 75). * `emergency_interval` - Emergency alert interval in minutes. * `alert_interval` - Alert alert interval in minutes. diff --git a/website/docs/r/fortios_endpointcontrol_settings.html.markdown b/website/docs/r/fortios_endpointcontrol_settings.html.markdown index bffa8d304..5c76bce22 100644 --- a/website/docs/r/fortios_endpointcontrol_settings.html.markdown +++ b/website/docs/r/fortios_endpointcontrol_settings.html.markdown @@ -7,7 +7,7 @@ description: |- --- # fortios_endpointcontrol_settings -Configure endpoint control settings. Applies to FortiOS Version `6.2.0,6.2.4,6.2.6,7.4.0,7.4.1,7.4.2,7.4.3,7.4.4,7.6.0`. +Configure endpoint control settings. Applies to FortiOS Version `6.2.0,6.2.4,6.2.6,7.4.0,7.4.1,7.4.2,7.4.3,7.4.4,7.4.5,7.6.0`. ## Example Usage diff --git a/website/docs/r/fortios_firewall_address6.html.markdown b/website/docs/r/fortios_firewall_address6.html.markdown index fd57a569f..704558366 100644 --- a/website/docs/r/fortios_firewall_address6.html.markdown +++ b/website/docs/r/fortios_firewall_address6.html.markdown @@ -57,6 +57,8 @@ The following arguments are supported: * `tenant` - Tenant. * `epg_name` - Endpoint group name. * `sdn_tag` - SDN Tag. +* `filter` - Match criteria filter. +* `sdn_addr_type` - Type of addresses to collect. Valid values: `private`, `public`, `all`. * `fabric_object` - Security Fabric global object setting. Valid values: `enable`, `disable`. * `dynamic_sort_subtable` - Sort sub-tables, please do not set this parameter when configuring static sub-tables. Options: [ false, true, natural, alphabetical ]. false: Default value, do not sort tables; true/natural: sort tables in natural order. For example: [ a10, a2 ] --> [ a2, a10 ]; alphabetical: sort tables in alphabetical order. For example: [ a10, a2 ] --> [ a10, a2 ]. * `get_all_tables` - Get all sub-tables including unconfigured tables. Do not set this variable to true if you configure sub-table in another resource, otherwise, conflicts and overwrite will occur. Options: [ false, true ]. false: Default value, do not get unconfigured tables; true: get all tables including unconfigured tables. diff --git a/website/docs/r/fortios_firewall_internetserviceappend.html.markdown b/website/docs/r/fortios_firewall_internetserviceappend.html.markdown index 1945437ea..9148cfa13 100644 --- a/website/docs/r/fortios_firewall_internetserviceappend.html.markdown +++ b/website/docs/r/fortios_firewall_internetserviceappend.html.markdown @@ -7,7 +7,7 @@ description: |- --- # fortios_firewall_internetserviceappend -Configure additional port mappings for Internet Services. Applies to FortiOS Version `6.2.4,6.2.6,6.4.1,6.4.2,6.4.10,6.4.11,6.4.12,6.4.13,6.4.14,6.4.15,7.0.0,7.0.1,7.0.2,7.0.3,7.0.4,7.0.5,7.0.6,7.0.7,7.0.8,7.0.9,7.0.10,7.0.11,7.0.12,7.0.13,7.0.14,7.0.15,7.2.0,7.2.1,7.2.2,7.2.3,7.2.4,7.2.6,7.2.7,7.2.8,7.2.9,7.4.0,7.4.1,7.4.2,7.4.3,7.4.4,7.6.0`. +Configure additional port mappings for Internet Services. Applies to FortiOS Version `6.2.4,6.2.6,6.4.1,6.4.2,6.4.10,6.4.11,6.4.12,6.4.13,6.4.14,6.4.15,7.0.0,7.0.1,7.0.2,7.0.3,7.0.4,7.0.5,7.0.6,7.0.7,7.0.8,7.0.9,7.0.10,7.0.11,7.0.12,7.0.13,7.0.14,7.0.15,7.2.0,7.2.1,7.2.2,7.2.3,7.2.4,7.2.6,7.2.7,7.2.8,7.2.9,7.2.10,7.4.0,7.4.1,7.4.2,7.4.3,7.4.4,7.4.5,7.6.0`. ## Argument Reference diff --git a/website/docs/r/fortios_firewall_sslserver.html.markdown b/website/docs/r/fortios_firewall_sslserver.html.markdown index 88ef35088..50eb738d2 100644 --- a/website/docs/r/fortios_firewall_sslserver.html.markdown +++ b/website/docs/r/fortios_firewall_sslserver.html.markdown @@ -40,7 +40,7 @@ The following arguments are supported: * `ssl_mode` - SSL/TLS mode for encryption and decryption of traffic. Valid values: `half`, `full`. * `add_header_x_forwarded_proto` - Enable/disable adding an X-Forwarded-Proto header to forwarded requests. Valid values: `enable`, `disable`. * `mapped_port` - Mapped server service port (1 - 65535, default = 80). -* `ssl_cert` - (Required) Name of certificate for SSL connections to this server. On FortiOS versions 6.2.0-7.2.9: default = "Fortinet_CA_SSL". On FortiOS versions 7.4.0-7.4.1: default = "Fortinet_SSL". +* `ssl_cert` - (Required) Name of certificate for SSL connections to this server. On FortiOS versions 6.2.0-7.2.10: default = "Fortinet_CA_SSL". On FortiOS versions 7.4.0-7.4.1: default = "Fortinet_SSL". * `ssl_dh_bits` - Bit-size of Diffie-Hellman (DH) prime used in DHE-RSA negotiation (default = 2048). Valid values: `768`, `1024`, `1536`, `2048`. * `ssl_algorithm` - Relative strength of encryption algorithms accepted in negotiation. Valid values: `high`, `medium`, `low`. * `ssl_client_renegotiation` - Allow or block client renegotiation by server. Valid values: `allow`, `deny`, `secure`. diff --git a/website/docs/r/fortios_rule_fmwp.html.markdown b/website/docs/r/fortios_rule_fmwp.html.markdown index 548294c36..e0fffd40b 100644 --- a/website/docs/r/fortios_rule_fmwp.html.markdown +++ b/website/docs/r/fortios_rule_fmwp.html.markdown @@ -7,7 +7,7 @@ description: |- --- # fortios_rule_fmwp -Show FMWP signatures. Applies to FortiOS Version `7.2.8,7.2.9,7.4.2,7.4.3,7.4.4,7.6.0`. +Show FMWP signatures. Applies to FortiOS Version `7.2.8,7.2.9,7.2.10,7.4.2,7.4.3,7.4.4,7.4.5,7.6.0`. ## Argument Reference diff --git a/website/docs/r/fortios_switchcontroller_managedswitch.html.markdown b/website/docs/r/fortios_switchcontroller_managedswitch.html.markdown index 3b3fc9f40..f468d685a 100644 --- a/website/docs/r/fortios_switchcontroller_managedswitch.html.markdown +++ b/website/docs/r/fortios_switchcontroller_managedswitch.html.markdown @@ -343,7 +343,7 @@ The `remote_log` block supports: The `storm_control` block supports: * `local_override` - Enable to override global FortiSwitch storm control settings for this FortiSwitch. Valid values: `enable`, `disable`. -* `rate` - Rate in packets per second at which storm control drops excess traffic, default=500. On FortiOS versions 6.2.0-7.2.9: 1 - 10000000. On FortiOS versions >= 7.4.0: 0-10000000, drop-all=0. +* `rate` - Rate in packets per second at which storm control drops excess traffic, default=500. On FortiOS versions 6.2.0-7.2.10: 1 - 10000000. On FortiOS versions >= 7.4.0: 0-10000000, drop-all=0. * `unknown_unicast` - Enable/disable storm control to drop unknown unicast traffic. Valid values: `enable`, `disable`. * `unknown_multicast` - Enable/disable storm control to drop unknown multicast traffic. Valid values: `enable`, `disable`. * `broadcast` - Enable/disable storm control to drop broadcast traffic. Valid values: `enable`, `disable`. diff --git a/website/docs/r/fortios_switchcontroller_stormcontrol.html.markdown b/website/docs/r/fortios_switchcontroller_stormcontrol.html.markdown index 31cb88b8a..4b57c0d74 100644 --- a/website/docs/r/fortios_switchcontroller_stormcontrol.html.markdown +++ b/website/docs/r/fortios_switchcontroller_stormcontrol.html.markdown @@ -13,7 +13,7 @@ Configure FortiSwitch storm control. The following arguments are supported: -* `rate` - Rate in packets per second at which storm control drops excess traffic, default=500. On FortiOS versions 6.2.0-7.2.9: 1 - 10000000. On FortiOS versions >= 7.4.0: 0-10000000, drop-all=0. +* `rate` - Rate in packets per second at which storm control drops excess traffic, default=500. On FortiOS versions 6.2.0-7.2.10: 1 - 10000000. On FortiOS versions >= 7.4.0: 0-10000000, drop-all=0. * `unknown_unicast` - Enable/disable storm control to drop unknown unicast traffic. Valid values: `enable`, `disable`. * `unknown_multicast` - Enable/disable storm control to drop unknown multicast traffic. Valid values: `enable`, `disable`. * `broadcast` - Enable/disable storm control to drop broadcast traffic. Valid values: `enable`, `disable`. diff --git a/website/docs/r/fortios_switchcontrollerptp_policy.html.markdown b/website/docs/r/fortios_switchcontrollerptp_policy.html.markdown index 434795c13..16d32b2a1 100644 --- a/website/docs/r/fortios_switchcontrollerptp_policy.html.markdown +++ b/website/docs/r/fortios_switchcontrollerptp_policy.html.markdown @@ -7,7 +7,7 @@ description: |- --- # fortios_switchcontrollerptp_policy -PTP policy configuration. Applies to FortiOS Version `6.4.2,6.4.10,6.4.11,6.4.12,6.4.13,6.4.14,6.4.15,7.0.0,7.0.1,7.0.2,7.0.3,7.0.4,7.0.5,7.0.6,7.0.7,7.0.8,7.0.9,7.0.10,7.0.11,7.0.12,7.0.13,7.0.14,7.0.15,7.2.0,7.2.1,7.2.2,7.2.3,7.2.4,7.2.6,7.2.7,7.2.8,7.2.9,7.4.0`. +PTP policy configuration. Applies to FortiOS Version `6.4.2,6.4.10,6.4.11,6.4.12,6.4.13,6.4.14,6.4.15,7.0.0,7.0.1,7.0.2,7.0.3,7.0.4,7.0.5,7.0.6,7.0.7,7.0.8,7.0.9,7.0.10,7.0.11,7.0.12,7.0.13,7.0.14,7.0.15,7.2.0,7.2.1,7.2.2,7.2.3,7.2.4,7.2.6,7.2.7,7.2.8,7.2.9,7.2.10,7.4.0`. ## Argument Reference diff --git a/website/docs/r/fortios_switchcontrollerptp_settings.html.markdown b/website/docs/r/fortios_switchcontrollerptp_settings.html.markdown index 421d96cc6..428dc3816 100644 --- a/website/docs/r/fortios_switchcontrollerptp_settings.html.markdown +++ b/website/docs/r/fortios_switchcontrollerptp_settings.html.markdown @@ -7,7 +7,7 @@ description: |- --- # fortios_switchcontrollerptp_settings -Global PTP settings. Applies to FortiOS Version `6.4.2,6.4.10,6.4.11,6.4.12,6.4.13,6.4.14,6.4.15,7.0.0,7.0.1,7.0.2,7.0.3,7.0.4,7.0.5,7.0.6,7.0.7,7.0.8,7.0.9,7.0.10,7.0.11,7.0.12,7.0.13,7.0.14,7.0.15,7.2.0,7.2.1,7.2.2,7.2.3,7.2.4,7.2.6,7.2.7,7.2.8,7.2.9,7.4.0`. +Global PTP settings. Applies to FortiOS Version `6.4.2,6.4.10,6.4.11,6.4.12,6.4.13,6.4.14,6.4.15,7.0.0,7.0.1,7.0.2,7.0.3,7.0.4,7.0.5,7.0.6,7.0.7,7.0.8,7.0.9,7.0.10,7.0.11,7.0.12,7.0.13,7.0.14,7.0.15,7.2.0,7.2.1,7.2.2,7.2.3,7.2.4,7.2.6,7.2.7,7.2.8,7.2.9,7.2.10,7.4.0`. ## Argument Reference diff --git a/website/docs/r/fortios_system_global.html.markdown b/website/docs/r/fortios_system_global.html.markdown index 7661e4053..b63bcb3b0 100644 --- a/website/docs/r/fortios_system_global.html.markdown +++ b/website/docs/r/fortios_system_global.html.markdown @@ -260,6 +260,7 @@ The following arguments are supported: * `log_uuid_address` - Enable/disable insertion of address UUIDs to traffic logs. Valid values: `enable`, `disable`. * `log_ssl_connection` - Enable/disable logging of SSL connection events. Valid values: `enable`, `disable`. * `gui_rest_api_cache` - Enable/disable REST API result caching on FortiGate. Valid values: `enable`, `disable`. +* `rest_api_key_url_query` - Enable/disable support for passing REST API keys through URL query parameters. Valid values: `enable`, `disable`. * `gui_cdn_domain_override` - Domain of CDN server. * `gui_fortiguard_resource_fetch` - Enable/disable retrieving static GUI resources from FortiGuard. Disabling it will improve GUI load time for air-gapped environments. Valid values: `enable`, `disable`. * `arp_max_entry` - Maximum number of dynamically learned MAC addresses that can be added to the ARP table (131072 - 2147483647, default = 131072). diff --git a/website/docs/r/fortios_system_interface.html.markdown b/website/docs/r/fortios_system_interface.html.markdown index 3f6f81a16..e21baf75c 100644 --- a/website/docs/r/fortios_system_interface.html.markdown +++ b/website/docs/r/fortios_system_interface.html.markdown @@ -306,7 +306,7 @@ The `vrrp` block supports: * `vrgrp` - VRRP group ID (1 - 65535). * `vrip` - IP address of the virtual router. * `priority` - Priority of the virtual router (1 - 255). -* `adv_interval` - Advertisement interval. On FortiOS versions 6.2.0-7.4.4: 1 - 255 seconds. On FortiOS versions >= 7.6.0: 250 - 255000 milliseconds. +* `adv_interval` - Advertisement interval. On FortiOS versions 6.2.0-7.4.5: 1 - 255 seconds. On FortiOS versions >= 7.6.0: 250 - 255000 milliseconds. * `start_time` - Startup time (1 - 255 seconds). * `preempt` - Enable/disable preempt mode. Valid values: `enable`, `disable`. * `accept_mode` - Enable/disable accept mode. Valid values: `enable`, `disable`. @@ -451,7 +451,7 @@ The `vrrp6` block supports: * `vrgrp` - VRRP group ID (1 - 65535). * `vrip6` - IPv6 address of the virtual router. * `priority` - Priority of the virtual router (1 - 255). -* `adv_interval` - Advertisement interval. On FortiOS versions 6.2.0-7.4.4: 1 - 255 seconds. On FortiOS versions >= 7.6.0: 250 - 255000 milliseconds. +* `adv_interval` - Advertisement interval. On FortiOS versions 6.2.0-7.4.5: 1 - 255 seconds. On FortiOS versions >= 7.6.0: 250 - 255000 milliseconds. * `start_time` - Startup time (1 - 255 seconds). * `preempt` - Enable/disable preempt mode. Valid values: `enable`, `disable`. * `accept_mode` - Enable/disable accept mode. Valid values: `enable`, `disable`. diff --git a/website/docs/r/fortios_system_sdnconnector.html.markdown b/website/docs/r/fortios_system_sdnconnector.html.markdown index 2980183a2..7ea387ddd 100644 --- a/website/docs/r/fortios_system_sdnconnector.html.markdown +++ b/website/docs/r/fortios_system_sdnconnector.html.markdown @@ -110,11 +110,13 @@ The `region_list` block supports: The `nic` block supports: * `name` - Network interface name. +* `peer_nic` - Peer network interface name. * `ip` - Configure IP configuration. The structure of `ip` block is documented below. The `ip` block supports: * `name` - IP configuration name. +* `private_ip` - Private IP address. * `public_ip` - Public IP name. * `resource_group` - Resource group of Azure public IP. diff --git a/website/docs/r/fortios_system_settings.html.markdown b/website/docs/r/fortios_system_settings.html.markdown index 4e1259f7c..bf340bfb0 100644 --- a/website/docs/r/fortios_system_settings.html.markdown +++ b/website/docs/r/fortios_system_settings.html.markdown @@ -76,6 +76,7 @@ The following arguments are supported: * `asymroute_icmp` - Enable/disable ICMP asymmetric routing. Valid values: `enable`, `disable`. * `tcp_session_without_syn` - Enable/disable allowing TCP session without SYN flags. Valid values: `enable`, `disable`. * `ses_denied_traffic` - Enable/disable including denied session in the session table. Valid values: `enable`, `disable`. +* `ses_denied_multicast_traffic` - Enable/disable including denied multicast session in the session table. Valid values: `enable`, `disable`. * `strict_src_check` - Enable/disable strict source verification. Valid values: `enable`, `disable`. * `allow_linkdown_path` - Enable/disable link down path. Valid values: `enable`, `disable`. * `asymroute6` - Enable/disable asymmetric IPv6 routing. Valid values: `enable`, `disable`. diff --git a/website/docs/r/fortios_system_speedtestsetting.html.markdown b/website/docs/r/fortios_system_speedtestsetting.html.markdown index 38ab156f3..df4517d42 100644 --- a/website/docs/r/fortios_system_speedtestsetting.html.markdown +++ b/website/docs/r/fortios_system_speedtestsetting.html.markdown @@ -7,7 +7,7 @@ description: |- --- # fortios_system_speedtestsetting -Configure speed test setting. Applies to FortiOS Version `7.2.6,7.2.7,7.2.8,7.2.9,7.4.1,7.4.2,7.4.3,7.4.4,7.6.0`. +Configure speed test setting. Applies to FortiOS Version `7.2.6,7.2.7,7.2.8,7.2.9,7.2.10,7.4.1,7.4.2,7.4.3,7.4.4,7.4.5,7.6.0`. ## Argument Reference diff --git a/website/docs/r/fortios_system_vnetunnel.html.markdown b/website/docs/r/fortios_system_vnetunnel.html.markdown index 78e2e9f0e..a7566bc47 100644 --- a/website/docs/r/fortios_system_vnetunnel.html.markdown +++ b/website/docs/r/fortios_system_vnetunnel.html.markdown @@ -7,7 +7,7 @@ description: |- --- # fortios_system_vnetunnel -Configure virtual network enabler tunnel. Applies to FortiOS Version `6.4.1,6.4.2,6.4.10,6.4.11,6.4.12,6.4.13,6.4.14,6.4.15,7.0.0,7.0.1,7.0.2,7.0.3,7.0.4,7.0.5,7.0.6,7.0.7,7.0.8,7.0.9,7.0.10,7.0.11,7.0.12,7.0.13,7.0.14,7.0.15,7.2.0,7.2.1,7.2.2,7.2.3,7.2.4,7.2.6,7.2.7,7.2.8,7.2.9,7.4.0,7.4.1,7.4.2,7.4.3,7.4.4`. +Configure virtual network enabler tunnel. Applies to FortiOS Version `6.4.1,6.4.2,6.4.10,6.4.11,6.4.12,6.4.13,6.4.14,6.4.15,7.0.0,7.0.1,7.0.2,7.0.3,7.0.4,7.0.5,7.0.6,7.0.7,7.0.8,7.0.9,7.0.10,7.0.11,7.0.12,7.0.13,7.0.14,7.0.15,7.2.0,7.2.1,7.2.2,7.2.3,7.2.4,7.2.6,7.2.7,7.2.8,7.2.9,7.2.10,7.4.0,7.4.1,7.4.2,7.4.3,7.4.4,7.4.5`. ## Argument Reference diff --git a/website/docs/r/fortios_user_externalidentityprovider.html.markdown b/website/docs/r/fortios_user_externalidentityprovider.html.markdown index ae7f51be7..f7c7be9f0 100644 --- a/website/docs/r/fortios_user_externalidentityprovider.html.markdown +++ b/website/docs/r/fortios_user_externalidentityprovider.html.markdown @@ -7,7 +7,7 @@ description: |- --- # fortios_user_externalidentityprovider -Configure external identity provider. Applies to FortiOS Version `7.2.8,7.2.9,7.4.2,7.4.3,7.4.4,7.6.0`. +Configure external identity provider. Applies to FortiOS Version `7.2.8,7.2.9,7.2.10,7.4.2,7.4.3,7.4.4,7.4.5,7.6.0`. ## Argument Reference diff --git a/website/docs/r/fortios_videofilter_youtubechannelfilter.html.markdown b/website/docs/r/fortios_videofilter_youtubechannelfilter.html.markdown index 8f7c4ecc8..f0a408e81 100644 --- a/website/docs/r/fortios_videofilter_youtubechannelfilter.html.markdown +++ b/website/docs/r/fortios_videofilter_youtubechannelfilter.html.markdown @@ -7,7 +7,7 @@ description: |- --- # fortios_videofilter_youtubechannelfilter -Configure YouTube channel filter. Applies to FortiOS Version `7.0.1,7.0.2,7.0.3,7.0.4,7.0.5,7.0.6,7.0.7,7.0.8,7.0.9,7.0.10,7.0.11,7.0.12,7.0.13,7.0.14,7.0.15,7.2.0,7.2.1,7.2.2,7.2.3,7.2.4,7.2.6,7.2.7,7.2.8,7.2.9,7.4.0,7.4.1`. +Configure YouTube channel filter. Applies to FortiOS Version `7.0.1,7.0.2,7.0.3,7.0.4,7.0.5,7.0.6,7.0.7,7.0.8,7.0.9,7.0.10,7.0.11,7.0.12,7.0.13,7.0.14,7.0.15,7.2.0,7.2.1,7.2.2,7.2.3,7.2.4,7.2.6,7.2.7,7.2.8,7.2.9,7.2.10,7.4.0,7.4.1`. ## Argument Reference diff --git a/website/docs/r/fortios_vpn_ocvpn.html.markdown b/website/docs/r/fortios_vpn_ocvpn.html.markdown index bcf3c4a3c..54109b49e 100644 --- a/website/docs/r/fortios_vpn_ocvpn.html.markdown +++ b/website/docs/r/fortios_vpn_ocvpn.html.markdown @@ -7,7 +7,7 @@ description: |- --- # fortios_vpn_ocvpn -Configure Overlay Controller VPN settings. Applies to FortiOS Version `6.2.4,6.2.6,6.4.0,6.4.1,6.4.2,6.4.10,6.4.11,6.4.12,6.4.13,6.4.14,6.4.15,7.0.0,7.0.1,7.0.2,7.0.3,7.0.4,7.0.5,7.0.6,7.0.7,7.0.8,7.0.9,7.0.10,7.0.11,7.0.12,7.0.13,7.0.14,7.0.15,7.2.0,7.2.1,7.2.2,7.2.3,7.2.4,7.2.6,7.2.7,7.2.8,7.2.9`. +Configure Overlay Controller VPN settings. Applies to FortiOS Version `6.2.4,6.2.6,6.4.0,6.4.1,6.4.2,6.4.10,6.4.11,6.4.12,6.4.13,6.4.14,6.4.15,7.0.0,7.0.1,7.0.2,7.0.3,7.0.4,7.0.5,7.0.6,7.0.7,7.0.8,7.0.9,7.0.10,7.0.11,7.0.12,7.0.13,7.0.14,7.0.15,7.2.0,7.2.1,7.2.2,7.2.3,7.2.4,7.2.6,7.2.7,7.2.8,7.2.9,7.2.10`. ## Argument Reference diff --git a/website/docs/r/fortios_webproxy_global.html.markdown b/website/docs/r/fortios_webproxy_global.html.markdown index b6c83d4aa..8ee76df4f 100644 --- a/website/docs/r/fortios_webproxy_global.html.markdown +++ b/website/docs/r/fortios_webproxy_global.html.markdown @@ -45,7 +45,7 @@ The following arguments are supported: * `tunnel_non_http` - Enable/disable allowing non-HTTP traffic. Allowed non-HTTP traffic is tunneled. Valid values: `enable`, `disable`. * `unknown_http_version` - Action to take when an unknown version of HTTP is encountered: reject, allow (tunnel), or proceed with best-effort. Valid values: `reject`, `tunnel`, `best-effort`. * `forward_server_affinity_timeout` - Period of time before the source IP's traffic is no longer assigned to the forwarding server (6 - 60 min, default = 30). -* `max_waf_body_cache_length` - Maximum length of HTTP messages processed by Web Application Firewall (WAF) (10 - 1024 Kbytes, default = 32). +* `max_waf_body_cache_length` - Maximum length of HTTP messages processed by Web Application Firewall (WAF) On FortiOS versions 6.2.0-7.4.4, >= 7.6.0: 10 - 1024 Kbytes, default = 32. On FortiOS versions 7.4.5: 1 - 1024 Kbytes, default = 1. * `webproxy_profile` - Name of the web proxy profile to apply when explicit proxy traffic is allowed by default and traffic is accepted that does not match an explicit proxy policy. * `learn_client_ip` - Enable/disable learning the client's IP address from headers. Valid values: `enable`, `disable`. * `always_learn_client_ip` - Enable/disable learning the client's IP address from headers for every request. Valid values: `enable`, `disable`. @@ -59,6 +59,7 @@ The following arguments are supported: * `log_forward_server` - Enable/disable forward server name logging in forward traffic log. Valid values: `enable`, `disable`. * `log_app_id` - Enable/disable always log application type in traffic log. Valid values: `enable`, `disable`. * `proxy_transparent_cert_inspection` - Enable/disable transparent proxy certificate inspection. Valid values: `enable`, `disable`. +* `request_obs_fold` - Action when HTTP/1.x request header contains obs-fold. Valid values: `replace-with-sp`, `block`, `keep`. * `dynamic_sort_subtable` - Sort sub-tables, please do not set this parameter when configuring static sub-tables. Options: [ false, true, natural, alphabetical ]. false: Default value, do not sort tables; true/natural: sort tables in natural order. For example: [ a10, a2 ] --> [ a2, a10 ]; alphabetical: sort tables in alphabetical order. For example: [ a10, a2 ] --> [ a10, a2 ]. * `get_all_tables` - Get all sub-tables including unconfigured tables. Do not set this variable to true if you configure sub-table in another resource, otherwise, conflicts and overwrite will occur. Options: [ false, true ]. false: Default value, do not get unconfigured tables; true: get all tables including unconfigured tables. * `vdomparam` - Specifies the vdom to which the resource will be applied when the FortiGate unit is running in VDOM mode. Only one vdom can be specified. If you want to inherit the vdom configuration of the provider, please do not set this parameter. diff --git a/website/docs/r/fortios_wirelesscontroller_wtpprofile.html.markdown b/website/docs/r/fortios_wirelesscontroller_wtpprofile.html.markdown index 62ba3f888..fd1b51855 100644 --- a/website/docs/r/fortios_wirelesscontroller_wtpprofile.html.markdown +++ b/website/docs/r/fortios_wirelesscontroller_wtpprofile.html.markdown @@ -510,6 +510,19 @@ The `lbs` block supports: * `fortipresence_unassoc` - Enable/disable FortiPresence finding and reporting unassociated stations. Valid values: `enable`, `disable`. * `fortipresence_ble` - Enable/disable FortiPresence finding and reporting BLE devices. Valid values: `enable`, `disable`. * `station_locate` - Enable/disable client station locating services for all clients, whether associated or not (default = disable). Valid values: `enable`, `disable`. +* `ble_rtls` - Set BLE Real Time Location Service (RTLS) support (default = none). Valid values: `none`, `polestar`, `evresys`. +* `ble_rtls_protocol` - Select the protocol to report Measurements, Advertising Data, or Location Data to Cloud Server. (default = WSS). Valid values: `WSS`. +* `ble_rtls_server_fqdn` - FQDN of BLE Real Time Location Service (RTLS) Server. +* `ble_rtls_server_path` - Path of BLE Real Time Location Service (RTLS) Server. +* `ble_rtls_server_token` - Access Token of BLE Real Time Location Service (RTLS) Server. +* `ble_rtls_server_port` - Port of BLE Real Time Location Service (RTLS) Server (default = 443). +* `ble_rtls_accumulation_interval` - Time that measurements should be accumulated in seconds (default = 2). +* `ble_rtls_reporting_interval` - Time between reporting accumulated measurements in seconds (default = 2). +* `ble_rtls_asset_uuid_list1` - Tags and asset UUID list 1 to be reported (string in the format of 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'). +* `ble_rtls_asset_uuid_list2` - Tags and asset UUID list 2 to be reported (string in the format of 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'). +* `ble_rtls_asset_uuid_list3` - Tags and asset UUID list 3 to be reported (string in the format of 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'). +* `ble_rtls_asset_uuid_list4` - Tags and asset UUID list 4 to be reported (string in the format of 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'). +* `ble_rtls_asset_addrgrp_list` - Tags and asset addrgrp list to be reported. * `polestar` - Enable/disable PoleStar BLE NAO Track Real Time Location Service (RTLS) support (default = disable). Valid values: `enable`, `disable`. * `polestar_protocol` - Select the protocol to report Measurements, Advertising Data, or Location Data to NAO Cloud. (default = WSS). Valid values: `WSS`. * `polestar_server_fqdn` - FQDN of PoleStar Nao Track Server (default = ws.nao-cloud.com).