diff --git a/.go-version b/.go-version index 66fae2a6..6245beec 100644 --- a/.go-version +++ b/.go-version @@ -1 +1 @@ -1.13.11 +1.22.1 diff --git a/CHANGELOG.md b/CHANGELOG.md index 0561b0f3..7c4a809e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ ## 1.13.0 (Unreleased) +## 1.12.1 (Jul 24, 2024) + +IMPROVEMENTS: +* Fix issue of variable mr could not set to 0 on resoure dvmdb_adom +* Fix invalid data issue for security console resources; +* Fix mkey issue of resource system_ntp_ntpserver; +* Fix issue when convert list to string; +* Fix crash issue if the HTTP response is empty; + ## 1.12.0 (Jun 3, 2024) IMPROVEMENTS: diff --git a/README.md b/README.md index 4f6db854..6863d5d7 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ - [Terraform](https://www.terraform.io/downloads.html) 0.12.x + - [Go](https://golang.org/doc/install) 1.21.x (to build the provider plugin) -- The provider can cover FortiManager 6.0, 6.2, 6.4, 7.0 versions. +- The provider can cover FortiManager 6.4 to 7.4 versions. ## Building the Provider diff --git a/fmg/config.go b/fmg/config.go index 469ad0f1..a79676f5 100644 --- a/fmg/config.go +++ b/fmg/config.go @@ -450,8 +450,8 @@ func convintflist2str(v, tfv interface{}) interface{} { return tfv } } - return strings.Join(vsList[:], ", ") } + return strings.Join(vsList[:], ", ") } return "" } diff --git a/fmg/provider.go b/fmg/provider.go index 9e755d10..c9f4ff63 100644 --- a/fmg/provider.go +++ b/fmg/provider.go @@ -126,7 +126,6 @@ func Provider() *schema.Provider { "fortimanager_dvm_cmd_update_devlist": resourceDvmCmdUpdateDevList(), "fortimanager_dvm_cmd_update_device": resourceDvmCmdUpdateDevice(), "fortimanager_dvmdb_adom": resourceDvmdbAdom(), - "fortimanager_dvmdb_device_vdom": resourceDvmdbDeviceVdom(), "fortimanager_dvmdb_group": resourceDvmdbGroup(), "fortimanager_dvmdb_revision": resourceDvmdbRevision(), "fortimanager_dvmdb_script": resourceDvmdbScript(), diff --git a/fmg/resource_dvmdb_adom.go b/fmg/resource_dvmdb_adom.go index 77451de8..639f28a3 100644 --- a/fmg/resource_dvmdb_adom.go +++ b/fmg/resource_dvmdb_adom.go @@ -966,7 +966,7 @@ func getObjectDvmdbAdom(d *schema.ResourceData) (*map[string]interface{}, error) } } - if v, ok := d.GetOk("mr"); ok || d.HasChange("mr") { + if v, ok := d.GetOkExists("mr"); ok { t, err := expandDvmdbAdomMr(d, v, "mr") if err != nil { return &obj, err diff --git a/fmg/resource_dvmdb_device_vdom.go b/fmg/resource_dvmdb_device_vdom.go deleted file mode 100644 index 6cd7fafa..00000000 --- a/fmg/resource_dvmdb_device_vdom.go +++ /dev/null @@ -1,463 +0,0 @@ -// Copyright 2020 Fortinet, Inc. All rights reserved. -// Author: Hongbin Lu (@fgtdev-hblu), Frank Shen (@frankshen01) -// Documentation: -// Hongbin Lu (@fgtdev-hblu), Frank Shen (@frankshen01), -// Xing Li (@lix-fortinet), Yue Wang (@yuew-ftnt) - -// Description: Device VDOM table. - -package fortimanager - -import ( - "fmt" - "log" - "strconv" - - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" -) - -func resourceDvmdbDeviceVdom() *schema.Resource { - return &schema.Resource{ - Create: resourceDvmdbDeviceVdomCreate, - Read: resourceDvmdbDeviceVdomRead, - Update: resourceDvmdbDeviceVdomUpdate, - Delete: resourceDvmdbDeviceVdomDelete, - - Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, - }, - - Schema: map[string]*schema.Schema{ - "scopetype": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Default: "inherit", - ForceNew: true, - ValidateFunc: validation.StringInSlice([]string{ - "adom", - "global", - "inherit", - }, false), - }, - "adom": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - ForceNew: true, - }, - "device_name": &schema.Schema{ - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "comments": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - "metafields": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - "name": &schema.Schema{ - Type: schema.TypeString, - ForceNew: true, - Optional: true, - }, - "opmode": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "rtm_prof_id": &schema.Schema{ - Type: schema.TypeInt, - Optional: true, - }, - "status": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - }, - "vdom_type": &schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "vpn_id": &schema.Schema{ - Type: schema.TypeInt, - Optional: true, - }, - }, - } -} - -func resourceDvmdbDeviceVdomCreate(d *schema.ResourceData, m interface{}) error { - c := m.(*FortiClient).Client - c.Retries = 1 - - paradict := make(map[string]string) - cfg := m.(*FortiClient).Cfg - adomv, err := adomChecking(cfg, d) - if err != nil { - return fmt.Errorf("Error adom configuration: %v", err) - } - paradict["adom"] = adomv - - device_name := d.Get("device_name").(string) - paradict["device"] = device_name - - obj, err := getObjectDvmdbDeviceVdom(d) - if err != nil { - return fmt.Errorf("Error creating DvmdbDeviceVdom resource while getting object: %v", err) - } - - _, err = c.CreateDvmdbDeviceVdom(obj, paradict) - - if err != nil { - return fmt.Errorf("Error creating DvmdbDeviceVdom resource: %v", err) - } - - d.SetId(getStringKey(d, "name")) - - return resourceDvmdbDeviceVdomRead(d, m) -} - -func resourceDvmdbDeviceVdomUpdate(d *schema.ResourceData, m interface{}) error { - mkey := d.Id() - c := m.(*FortiClient).Client - c.Retries = 1 - - paradict := make(map[string]string) - cfg := m.(*FortiClient).Cfg - adomv, err := adomChecking(cfg, d) - if err != nil { - return fmt.Errorf("Error adom configuration: %v", err) - } - paradict["adom"] = adomv - - device_name := d.Get("device_name").(string) - paradict["device"] = device_name - - obj, err := getObjectDvmdbDeviceVdom(d) - if err != nil { - return fmt.Errorf("Error updating DvmdbDeviceVdom resource while getting object: %v", err) - } - - _, err = c.UpdateDvmdbDeviceVdom(obj, mkey, paradict) - if err != nil { - return fmt.Errorf("Error updating DvmdbDeviceVdom resource: %v", err) - } - - log.Printf(strconv.Itoa(c.Retries)) - - d.SetId(getStringKey(d, "name")) - - return resourceDvmdbDeviceVdomRead(d, m) -} - -func resourceDvmdbDeviceVdomDelete(d *schema.ResourceData, m interface{}) error { - mkey := d.Id() - - c := m.(*FortiClient).Client - c.Retries = 1 - - paradict := make(map[string]string) - cfg := m.(*FortiClient).Cfg - adomv, err := adomChecking(cfg, d) - if err != nil { - return fmt.Errorf("Error adom configuration: %v", err) - } - paradict["adom"] = adomv - - device_name := d.Get("device_name").(string) - paradict["device"] = device_name - - err = c.DeleteDvmdbDeviceVdom(mkey, paradict) - if err != nil { - return fmt.Errorf("Error deleting DvmdbDeviceVdom resource: %v", err) - } - - d.SetId("") - - return nil -} - -func resourceDvmdbDeviceVdomRead(d *schema.ResourceData, m interface{}) error { - mkey := d.Id() - - c := m.(*FortiClient).Client - c.Retries = 1 - - paradict := make(map[string]string) - cfg := m.(*FortiClient).Cfg - adomv, err := adomChecking(cfg, d) - if err != nil { - return fmt.Errorf("Error adom configuration: %v", err) - } - paradict["adom"] = adomv - - device_name := d.Get("device_name").(string) - if device_name == "" { - device_name = importOptionChecking(m.(*FortiClient).Cfg, "device_name") - if device_name == "" { - return fmt.Errorf("Parameter device_name is missing") - } - if err = d.Set("device_name", device_name); err != nil { - return fmt.Errorf("Error set params device_name: %v", err) - } - } - paradict["device"] = device_name - - o, err := c.ReadDvmdbDeviceVdom(mkey, paradict) - if err != nil { - return fmt.Errorf("Error reading DvmdbDeviceVdom resource: %v", err) - } - - if o == nil { - log.Printf("[WARN] resource (%s) not found, removing from state", d.Id()) - d.SetId("") - return nil - } - - err = refreshObjectDvmdbDeviceVdom(d, o) - if err != nil { - return fmt.Errorf("Error reading DvmdbDeviceVdom resource from API: %v", err) - } - return nil -} - -func flattenDvmdbDeviceVdomComments2edl(v interface{}, d *schema.ResourceData, pre string) interface{} { - return v -} - -func flattenDvmdbDeviceVdomMetaFields2edl(v interface{}, d *schema.ResourceData, pre string) interface{} { - return v -} - -func flattenDvmdbDeviceVdomName2edl(v interface{}, d *schema.ResourceData, pre string) interface{} { - return v -} - -func flattenDvmdbDeviceVdomOpmode2edl(v interface{}, d *schema.ResourceData, pre string) interface{} { - return v -} - -func flattenDvmdbDeviceVdomRtmProfId2edl(v interface{}, d *schema.ResourceData, pre string) interface{} { - return v -} - -func flattenDvmdbDeviceVdomStatus2edl(v interface{}, d *schema.ResourceData, pre string) interface{} { - return v -} - -func flattenDvmdbDeviceVdomVdomType2edl(v interface{}, d *schema.ResourceData, pre string) interface{} { - return v -} - -func flattenDvmdbDeviceVdomVpnId2edl(v interface{}, d *schema.ResourceData, pre string) interface{} { - return v -} - -func refreshObjectDvmdbDeviceVdom(d *schema.ResourceData, o map[string]interface{}) error { - var err error - - if stValue := d.Get("scopetype"); stValue == "" { - d.Set("scopetype", "inherit") - } - - if err = d.Set("comments", flattenDvmdbDeviceVdomComments2edl(o["comments"], d, "comments")); err != nil { - if vv, ok := fortiAPIPatch(o["comments"], "DvmdbDeviceVdom-Comments"); ok { - if err = d.Set("comments", vv); err != nil { - return fmt.Errorf("Error reading comments: %v", err) - } - } else { - return fmt.Errorf("Error reading comments: %v", err) - } - } - - if err = d.Set("metafields", flattenDvmdbDeviceVdomMetaFields2edl(o["meta fields"], d, "metafields")); err != nil { - if vv, ok := fortiAPIPatch(o["meta fields"], "DvmdbDeviceVdom-MetaFields"); ok { - if err = d.Set("metafields", vv); err != nil { - return fmt.Errorf("Error reading metafields: %v", err) - } - } else { - return fmt.Errorf("Error reading metafields: %v", err) - } - } - - if err = d.Set("name", flattenDvmdbDeviceVdomName2edl(o["name"], d, "name")); err != nil { - if vv, ok := fortiAPIPatch(o["name"], "DvmdbDeviceVdom-Name"); ok { - if err = d.Set("name", vv); err != nil { - return fmt.Errorf("Error reading name: %v", err) - } - } else { - return fmt.Errorf("Error reading name: %v", err) - } - } - - if err = d.Set("opmode", flattenDvmdbDeviceVdomOpmode2edl(o["opmode"], d, "opmode")); err != nil { - if vv, ok := fortiAPIPatch(o["opmode"], "DvmdbDeviceVdom-Opmode"); ok { - if err = d.Set("opmode", vv); err != nil { - return fmt.Errorf("Error reading opmode: %v", err) - } - } else { - return fmt.Errorf("Error reading opmode: %v", err) - } - } - - if err = d.Set("rtm_prof_id", flattenDvmdbDeviceVdomRtmProfId2edl(o["rtm_prof_id"], d, "rtm_prof_id")); err != nil { - if vv, ok := fortiAPIPatch(o["rtm_prof_id"], "DvmdbDeviceVdom-RtmProfId"); ok { - if err = d.Set("rtm_prof_id", vv); err != nil { - return fmt.Errorf("Error reading rtm_prof_id: %v", err) - } - } else { - return fmt.Errorf("Error reading rtm_prof_id: %v", err) - } - } - - if err = d.Set("status", flattenDvmdbDeviceVdomStatus2edl(o["status"], d, "status")); err != nil { - if vv, ok := fortiAPIPatch(o["status"], "DvmdbDeviceVdom-Status"); ok { - if err = d.Set("status", vv); err != nil { - return fmt.Errorf("Error reading status: %v", err) - } - } else { - return fmt.Errorf("Error reading status: %v", err) - } - } - - if err = d.Set("vdom_type", flattenDvmdbDeviceVdomVdomType2edl(o["vdom_type"], d, "vdom_type")); err != nil { - if vv, ok := fortiAPIPatch(o["vdom_type"], "DvmdbDeviceVdom-VdomType"); ok { - if err = d.Set("vdom_type", vv); err != nil { - return fmt.Errorf("Error reading vdom_type: %v", err) - } - } else { - return fmt.Errorf("Error reading vdom_type: %v", err) - } - } - - if err = d.Set("vpn_id", flattenDvmdbDeviceVdomVpnId2edl(o["vpn_id"], d, "vpn_id")); err != nil { - if vv, ok := fortiAPIPatch(o["vpn_id"], "DvmdbDeviceVdom-VpnId"); ok { - if err = d.Set("vpn_id", vv); err != nil { - return fmt.Errorf("Error reading vpn_id: %v", err) - } - } else { - return fmt.Errorf("Error reading vpn_id: %v", err) - } - } - - return nil -} - -func flattenDvmdbDeviceVdomFortiTestDebug(d *schema.ResourceData, fosdebugsn int, fosdebugbeg int, fosdebugend int) { - log.Printf(strconv.Itoa(fosdebugsn)) - e := validation.IntBetween(fosdebugbeg, fosdebugend) - log.Printf("ER List: %v", e) -} - -func expandDvmdbDeviceVdomComments2edl(d *schema.ResourceData, v interface{}, pre string) (interface{}, error) { - return v, nil -} - -func expandDvmdbDeviceVdomMetaFields2edl(d *schema.ResourceData, v interface{}, pre string) (interface{}, error) { - return v, nil -} - -func expandDvmdbDeviceVdomName2edl(d *schema.ResourceData, v interface{}, pre string) (interface{}, error) { - return v, nil -} - -func expandDvmdbDeviceVdomOpmode2edl(d *schema.ResourceData, v interface{}, pre string) (interface{}, error) { - return v, nil -} - -func expandDvmdbDeviceVdomRtmProfId2edl(d *schema.ResourceData, v interface{}, pre string) (interface{}, error) { - return v, nil -} - -func expandDvmdbDeviceVdomStatus2edl(d *schema.ResourceData, v interface{}, pre string) (interface{}, error) { - return v, nil -} - -func expandDvmdbDeviceVdomVdomType2edl(d *schema.ResourceData, v interface{}, pre string) (interface{}, error) { - return v, nil -} - -func expandDvmdbDeviceVdomVpnId2edl(d *schema.ResourceData, v interface{}, pre string) (interface{}, error) { - return v, nil -} - -func getObjectDvmdbDeviceVdom(d *schema.ResourceData) (*map[string]interface{}, error) { - obj := make(map[string]interface{}) - - if v, ok := d.GetOk("comments"); ok || d.HasChange("comments") { - t, err := expandDvmdbDeviceVdomComments2edl(d, v, "comments") - if err != nil { - return &obj, err - } else if t != nil { - obj["comments"] = t - } - } - - if v, ok := d.GetOk("metafields"); ok || d.HasChange("metafields") { - t, err := expandDvmdbDeviceVdomMetaFields2edl(d, v, "metafields") - if err != nil { - return &obj, err - } else if t != nil { - obj["meta fields"] = t - } - } - - if v, ok := d.GetOk("name"); ok || d.HasChange("name") { - t, err := expandDvmdbDeviceVdomName2edl(d, v, "name") - if err != nil { - return &obj, err - } else if t != nil { - obj["name"] = t - } - } - - if v, ok := d.GetOk("opmode"); ok || d.HasChange("opmode") { - t, err := expandDvmdbDeviceVdomOpmode2edl(d, v, "opmode") - if err != nil { - return &obj, err - } else if t != nil { - obj["opmode"] = t - } - } - - if v, ok := d.GetOk("rtm_prof_id"); ok || d.HasChange("rtm_prof_id") { - t, err := expandDvmdbDeviceVdomRtmProfId2edl(d, v, "rtm_prof_id") - if err != nil { - return &obj, err - } else if t != nil { - obj["rtm_prof_id"] = t - } - } - - if v, ok := d.GetOk("status"); ok || d.HasChange("status") { - t, err := expandDvmdbDeviceVdomStatus2edl(d, v, "status") - if err != nil { - return &obj, err - } else if t != nil { - obj["status"] = t - } - } - - if v, ok := d.GetOk("vdom_type"); ok || d.HasChange("vdom_type") { - t, err := expandDvmdbDeviceVdomVdomType2edl(d, v, "vdom_type") - if err != nil { - return &obj, err - } else if t != nil { - obj["vdom_type"] = t - } - } - - if v, ok := d.GetOk("vpn_id"); ok || d.HasChange("vpn_id") { - t, err := expandDvmdbDeviceVdomVpnId2edl(d, v, "vpn_id") - if err != nil { - return &obj, err - } else if t != nil { - obj["vpn_id"] = t - } - } - - return &obj, nil -} diff --git a/fmg/resource_dvmdb_script_execute.go b/fmg/resource_dvmdb_script_execute.go index 7db4a035..40916fbb 100644 --- a/fmg/resource_dvmdb_script_execute.go +++ b/fmg/resource_dvmdb_script_execute.go @@ -134,7 +134,7 @@ func resourceDvmdbScriptExecuteRead(d *schema.ResourceData, m interface{}) error } func flattenDvmdbScriptExecuteAdom2edl(v interface{}, d *schema.ResourceData, pre string) interface{} { - return convintflist2str(v, d.Get(pre)) + return v } func flattenDvmdbScriptExecutePackage2edl(v interface{}, d *schema.ResourceData, pre string) interface{} { @@ -283,7 +283,7 @@ func flattenDvmdbScriptExecuteFortiTestDebug(d *schema.ResourceData, fosdebugsn } func expandDvmdbScriptExecuteAdom2edl(d *schema.ResourceData, v interface{}, pre string) (interface{}, error) { - return convstr2list(v, nil), nil + return v, nil } func expandDvmdbScriptExecutePackage2edl(d *schema.ResourceData, v interface{}, pre string) (interface{}, error) { diff --git a/fmg/resource_object_firewall_vip.go b/fmg/resource_object_firewall_vip.go index dc4801ef..79d989d1 100644 --- a/fmg/resource_object_firewall_vip.go +++ b/fmg/resource_object_firewall_vip.go @@ -140,10 +140,12 @@ func resourceObjectFirewallVip() *schema.Resource { "h2_support": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "h3_support": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "http_cookie_age": &schema.Schema{ Type: schema.TypeInt, @@ -192,6 +194,7 @@ func resourceObjectFirewallVip() *schema.Resource { "http_multiplex_ttl": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "http_redirect": &schema.Schema{ Type: schema.TypeString, @@ -534,6 +537,7 @@ func resourceObjectFirewallVip() *schema.Resource { "ssl_server_renegotiation": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "ssl_server_session_state_max": &schema.Schema{ Type: schema.TypeInt, diff --git a/fmg/resource_object_firewall_vip46.go b/fmg/resource_object_firewall_vip46.go index 97fc366c..ec096393 100644 --- a/fmg/resource_object_firewall_vip46.go +++ b/fmg/resource_object_firewall_vip46.go @@ -82,6 +82,7 @@ func resourceObjectFirewallVip46() *schema.Resource { "arp_reply": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "color": &schema.Schema{ Type: schema.TypeInt, @@ -106,6 +107,7 @@ func resourceObjectFirewallVip46() *schema.Resource { "ldb_method": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "mappedip": &schema.Schema{ Type: schema.TypeString, @@ -122,10 +124,12 @@ func resourceObjectFirewallVip46() *schema.Resource { "portforward": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "protocol": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "server_type": &schema.Schema{ Type: schema.TypeString, @@ -144,6 +148,7 @@ func resourceObjectFirewallVip46() *schema.Resource { "type": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "uuid": &schema.Schema{ Type: schema.TypeString, diff --git a/fmg/resource_object_firewall_vip64.go b/fmg/resource_object_firewall_vip64.go index b32b3de7..354067e4 100644 --- a/fmg/resource_object_firewall_vip64.go +++ b/fmg/resource_object_firewall_vip64.go @@ -82,6 +82,7 @@ func resourceObjectFirewallVip64() *schema.Resource { "arp_reply": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "color": &schema.Schema{ Type: schema.TypeInt, @@ -106,6 +107,7 @@ func resourceObjectFirewallVip64() *schema.Resource { "ldb_method": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "mappedip": &schema.Schema{ Type: schema.TypeString, @@ -122,10 +124,12 @@ func resourceObjectFirewallVip64() *schema.Resource { "portforward": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "protocol": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "server_type": &schema.Schema{ Type: schema.TypeString, @@ -140,6 +144,7 @@ func resourceObjectFirewallVip64() *schema.Resource { "type": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "uuid": &schema.Schema{ Type: schema.TypeString, diff --git a/fmg/resource_object_fsp_vlan.go b/fmg/resource_object_fsp_vlan.go index a86f8896..fb6ee3d3 100644 --- a/fmg/resource_object_fsp_vlan.go +++ b/fmg/resource_object_fsp_vlan.go @@ -163,6 +163,7 @@ func resourceObjectFspVlan() *schema.Resource { "end_ip": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "id": &schema.Schema{ Type: schema.TypeInt, @@ -175,10 +176,12 @@ func resourceObjectFspVlan() *schema.Resource { "start_ip": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "uci_match": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "uci_string": &schema.Schema{ Type: schema.TypeSet, @@ -189,6 +192,7 @@ func resourceObjectFspVlan() *schema.Resource { "vci_match": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "vci_string": &schema.Schema{ Type: schema.TypeSet, @@ -224,6 +228,7 @@ func resourceObjectFspVlan() *schema.Resource { "end_ip": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "id": &schema.Schema{ Type: schema.TypeInt, @@ -236,10 +241,12 @@ func resourceObjectFspVlan() *schema.Resource { "start_ip": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "uci_match": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "uci_string": &schema.Schema{ Type: schema.TypeSet, @@ -250,6 +257,7 @@ func resourceObjectFspVlan() *schema.Resource { "vci_match": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "vci_string": &schema.Schema{ Type: schema.TypeSet, @@ -356,10 +364,12 @@ func resourceObjectFspVlan() *schema.Resource { "type": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "uci_match": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "uci_string": &schema.Schema{ Type: schema.TypeSet, @@ -374,6 +384,7 @@ func resourceObjectFspVlan() *schema.Resource { "vci_match": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "vci_string": &schema.Schema{ Type: schema.TypeSet, @@ -387,6 +398,7 @@ func resourceObjectFspVlan() *schema.Resource { "relay_agent": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "reserved_address": &schema.Schema{ Type: schema.TypeList, @@ -396,6 +408,7 @@ func resourceObjectFspVlan() *schema.Resource { "action": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "circuit_id": &schema.Schema{ Type: schema.TypeString, @@ -416,10 +429,12 @@ func resourceObjectFspVlan() *schema.Resource { "ip": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "mac": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "remote_id": &schema.Schema{ Type: schema.TypeString, @@ -432,6 +447,7 @@ func resourceObjectFspVlan() *schema.Resource { "type": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, }, }, @@ -444,6 +460,7 @@ func resourceObjectFspVlan() *schema.Resource { "shared_subnet": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "status": &schema.Schema{ Type: schema.TypeString, @@ -545,18 +562,22 @@ func resourceObjectFspVlan() *schema.Resource { "auto_configuration": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "auto_managed_status": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "conflicted_ip_timeout": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "ddns_auth": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "ddns_key": &schema.Schema{ Type: schema.TypeString, @@ -569,18 +590,22 @@ func resourceObjectFspVlan() *schema.Resource { "ddns_server_ip": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "ddns_ttl": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "ddns_update": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "ddns_update_override": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "ddns_zone": &schema.Schema{ Type: schema.TypeString, @@ -589,30 +614,37 @@ func resourceObjectFspVlan() *schema.Resource { "default_gateway": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "dhcp_settings_from_fortiipam": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "dns_server1": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "dns_server2": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "dns_server3": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "dns_server4": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "dns_service": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "domain": &schema.Schema{ Type: schema.TypeString, @@ -630,6 +662,7 @@ func resourceObjectFspVlan() *schema.Resource { "end_ip": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "id": &schema.Schema{ Type: schema.TypeInt, @@ -642,10 +675,12 @@ func resourceObjectFspVlan() *schema.Resource { "start_ip": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "uci_match": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "uci_string": &schema.Schema{ Type: schema.TypeSet, @@ -656,6 +691,7 @@ func resourceObjectFspVlan() *schema.Resource { "vci_match": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "vci_string": &schema.Schema{ Type: schema.TypeSet, @@ -673,6 +709,7 @@ func resourceObjectFspVlan() *schema.Resource { "forticlient_on_net_status": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "id": &schema.Schema{ Type: schema.TypeInt, @@ -690,6 +727,7 @@ func resourceObjectFspVlan() *schema.Resource { "end_ip": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "id": &schema.Schema{ Type: schema.TypeInt, @@ -702,10 +740,12 @@ func resourceObjectFspVlan() *schema.Resource { "start_ip": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "uci_match": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "uci_string": &schema.Schema{ Type: schema.TypeSet, @@ -716,6 +756,7 @@ func resourceObjectFspVlan() *schema.Resource { "vci_match": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "vci_string": &schema.Schema{ Type: schema.TypeSet, @@ -733,34 +774,42 @@ func resourceObjectFspVlan() *schema.Resource { "lease_time": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "mac_acl_default_action": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "netmask": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "next_server": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "ntp_server1": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "ntp_server2": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "ntp_server3": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "ntp_service": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "option1": &schema.Schema{ Type: schema.TypeSet, @@ -814,10 +863,12 @@ func resourceObjectFspVlan() *schema.Resource { "type": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "uci_match": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "uci_string": &schema.Schema{ Type: schema.TypeSet, @@ -832,6 +883,7 @@ func resourceObjectFspVlan() *schema.Resource { "vci_match": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "vci_string": &schema.Schema{ Type: schema.TypeSet, @@ -845,6 +897,7 @@ func resourceObjectFspVlan() *schema.Resource { "relay_agent": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "reserved_address": &schema.Schema{ Type: schema.TypeList, @@ -854,6 +907,7 @@ func resourceObjectFspVlan() *schema.Resource { "action": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "circuit_id": &schema.Schema{ Type: schema.TypeString, @@ -874,10 +928,12 @@ func resourceObjectFspVlan() *schema.Resource { "ip": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "mac": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "remote_id": &schema.Schema{ Type: schema.TypeString, @@ -890,6 +946,7 @@ func resourceObjectFspVlan() *schema.Resource { "type": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, }, }, @@ -897,14 +954,17 @@ func resourceObjectFspVlan() *schema.Resource { "server_type": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "shared_subnet": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "status": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "tftp_server": &schema.Schema{ Type: schema.TypeSet, @@ -919,10 +979,12 @@ func resourceObjectFspVlan() *schema.Resource { "timezone_option": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "vci_match": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "vci_string": &schema.Schema{ Type: schema.TypeSet, @@ -933,26 +995,32 @@ func resourceObjectFspVlan() *schema.Resource { "wifi_ac_service": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "wifi_ac1": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "wifi_ac2": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "wifi_ac3": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "wins_server1": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "wins_server2": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, }, }, @@ -3276,6 +3344,7 @@ func resourceObjectFspVlan() *schema.Resource { "ip": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, }, }, diff --git a/fmg/resource_object_fsp_vlan_interface.go b/fmg/resource_object_fsp_vlan_interface.go index f0540125..eeb9b60c 100644 --- a/fmg/resource_object_fsp_vlan_interface.go +++ b/fmg/resource_object_fsp_vlan_interface.go @@ -1849,6 +1849,7 @@ func resourceObjectFspVlanInterface() *schema.Resource { "ip": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, }, }, diff --git a/fmg/resource_object_fsp_vlan_interface_vrrp.go b/fmg/resource_object_fsp_vlan_interface_vrrp.go index a233c181..580eb510 100644 --- a/fmg/resource_object_fsp_vlan_interface_vrrp.go +++ b/fmg/resource_object_fsp_vlan_interface_vrrp.go @@ -87,6 +87,7 @@ func resourceObjectFspVlanInterfaceVrrp() *schema.Resource { "ip": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, }, }, diff --git a/fmg/resource_object_switchcontroller_qos_queuepolicy.go b/fmg/resource_object_switchcontroller_qos_queuepolicy.go index e5f19d0e..fac85f4d 100644 --- a/fmg/resource_object_switchcontroller_qos_queuepolicy.go +++ b/fmg/resource_object_switchcontroller_qos_queuepolicy.go @@ -57,10 +57,12 @@ func resourceObjectSwitchControllerQosQueuePolicy() *schema.Resource { "drop_policy": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "ecn": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "max_rate": &schema.Schema{ Type: schema.TypeInt, @@ -85,6 +87,7 @@ func resourceObjectSwitchControllerQosQueuePolicy() *schema.Resource { "weight": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, }, }, diff --git a/fmg/resource_object_user_ldap.go b/fmg/resource_object_user_ldap.go index bf976793..c513b21c 100644 --- a/fmg/resource_object_user_ldap.go +++ b/fmg/resource_object_user_ldap.go @@ -116,6 +116,7 @@ func resourceObjectUserLdap() *schema.Resource { "account_key_cert_field": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "account_key_filter": &schema.Schema{ Type: schema.TypeString, diff --git a/fmg/resource_object_user_radius.go b/fmg/resource_object_user_radius.go index 3b942d34..fa819882 100644 --- a/fmg/resource_object_user_radius.go +++ b/fmg/resource_object_user_radius.go @@ -167,10 +167,12 @@ func resourceObjectUserRadius() *schema.Resource { "account_key_cert_field": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "account_key_processing": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "accounting_server": &schema.Schema{ Type: schema.TypeList, @@ -243,6 +245,7 @@ func resourceObjectUserRadius() *schema.Resource { "call_station_id_type": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "class": &schema.Schema{ Type: schema.TypeSet, @@ -412,14 +415,17 @@ func resourceObjectUserRadius() *schema.Resource { "mac_case": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "mac_password_delimiter": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "mac_username_delimiter": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "nas_id": &schema.Schema{ Type: schema.TypeString, @@ -428,6 +434,7 @@ func resourceObjectUserRadius() *schema.Resource { "nas_id_type": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "nas_ip": &schema.Schema{ Type: schema.TypeString, @@ -533,6 +540,7 @@ func resourceObjectUserRadius() *schema.Resource { "server_identity_check": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "source_ip": &schema.Schema{ Type: schema.TypeString, @@ -554,6 +562,7 @@ func resourceObjectUserRadius() *schema.Resource { "status_ttl": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "switch_controller_acct_fast_framedip_detect": &schema.Schema{ Type: schema.TypeInt, @@ -589,10 +598,12 @@ func resourceObjectUserRadius() *schema.Resource { "tls_min_proto_version": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "transport_protocol": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "use_group_for_profile": &schema.Schema{ Type: schema.TypeString, diff --git a/fmg/resource_object_user_saml.go b/fmg/resource_object_user_saml.go index a918c68f..7b8d3270 100644 --- a/fmg/resource_object_user_saml.go +++ b/fmg/resource_object_user_saml.go @@ -92,6 +92,7 @@ func resourceObjectUserSaml() *schema.Resource { "adfs_claim": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "auth_url": &schema.Schema{ Type: schema.TypeString, @@ -104,10 +105,12 @@ func resourceObjectUserSaml() *schema.Resource { "clock_tolerance": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "digest_method": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "entity_id": &schema.Schema{ Type: schema.TypeString, @@ -140,10 +143,12 @@ func resourceObjectUserSaml() *schema.Resource { "limit_relaystate": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "reauth": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "single_logout_url": &schema.Schema{ Type: schema.TypeString, diff --git a/fmg/resource_object_webproxy_forwardservergroup.go b/fmg/resource_object_webproxy_forwardservergroup.go index b57abb1f..e4bb730d 100644 --- a/fmg/resource_object_webproxy_forwardservergroup.go +++ b/fmg/resource_object_webproxy_forwardservergroup.go @@ -77,6 +77,7 @@ func resourceObjectWebProxyForwardServerGroup() *schema.Resource { "weight": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, }, }, diff --git a/fmg/resource_object_wirelesscontroller_vap.go b/fmg/resource_object_wirelesscontroller_vap.go index 64c24a95..32cdee2a 100644 --- a/fmg/resource_object_wirelesscontroller_vap.go +++ b/fmg/resource_object_wirelesscontroller_vap.go @@ -448,6 +448,7 @@ func resourceObjectWirelessControllerVap() *schema.Resource { "address_group_policy": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "alias": &schema.Schema{ Type: schema.TypeString, @@ -460,10 +461,12 @@ func resourceObjectWirelessControllerVap() *schema.Resource { "application_detection_engine": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "application_dscp_marking": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "application_list": &schema.Schema{ Type: schema.TypeString, @@ -472,6 +475,7 @@ func resourceObjectWirelessControllerVap() *schema.Resource { "application_report_intv": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "atf_weight": &schema.Schema{ Type: schema.TypeInt, @@ -538,6 +542,7 @@ func resourceObjectWirelessControllerVap() *schema.Resource { "captive_portal_fw_accounting": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "captive_portal_macauth_radius_secret": &schema.Schema{ Type: schema.TypeSet, @@ -572,6 +577,7 @@ func resourceObjectWirelessControllerVap() *schema.Resource { "dhcp_address_enforcement": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "dhcp_lease_time": &schema.Schema{ Type: schema.TypeInt, @@ -727,10 +733,12 @@ func resourceObjectWirelessControllerVap() *schema.Resource { "l3_roaming": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "l3_roaming_mode": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "ldpc": &schema.Schema{ Type: schema.TypeString, @@ -1186,6 +1194,7 @@ func resourceObjectWirelessControllerVap() *schema.Resource { "sticky_client_threshold_6g": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "target_wake_time": &schema.Schema{ Type: schema.TypeString, diff --git a/fmg/resource_securityconsole_abort.go b/fmg/resource_securityconsole_abort.go index f68107e0..3f325488 100644 --- a/fmg/resource_securityconsole_abort.go +++ b/fmg/resource_securityconsole_abort.go @@ -81,7 +81,7 @@ func resourceSecurityconsoleAbortRead(d *schema.ResourceData, m interface{}) err } func flattenSecurityconsoleAbortAdom(v interface{}, d *schema.ResourceData, pre string) interface{} { - return convintflist2str(v, d.Get(pre)) + return v } func refreshObjectSecurityconsoleAbort(d *schema.ResourceData, o map[string]interface{}) error { @@ -107,7 +107,7 @@ func flattenSecurityconsoleAbortFortiTestDebug(d *schema.ResourceData, fosdebugs } func expandSecurityconsoleAbortAdom(d *schema.ResourceData, v interface{}, pre string) (interface{}, error) { - return convstr2list(v, nil), nil + return v, nil } func getObjectSecurityconsoleAbort(d *schema.ResourceData) (*map[string]interface{}, error) { diff --git a/fmg/resource_securityconsole_assign_package.go b/fmg/resource_securityconsole_assign_package.go index 6c26e51f..80084487 100644 --- a/fmg/resource_securityconsole_assign_package.go +++ b/fmg/resource_securityconsole_assign_package.go @@ -116,7 +116,7 @@ func flattenSecurityconsoleAssignPackageFlags(v interface{}, d *schema.ResourceD } func flattenSecurityconsoleAssignPackagePkg(v interface{}, d *schema.ResourceData, pre string) interface{} { - return convintflist2str(v, d.Get(pre)) + return v } func flattenSecurityconsoleAssignPackageTarget(v interface{}, d *schema.ResourceData, pre string) []map[string]interface{} { @@ -167,7 +167,7 @@ func flattenSecurityconsoleAssignPackageTarget(v interface{}, d *schema.Resource } func flattenSecurityconsoleAssignPackageTargetAdom(v interface{}, d *schema.ResourceData, pre string) interface{} { - return convintflist2str(v, d.Get(pre)) + return v } func flattenSecurityconsoleAssignPackageTargetExcluded(v interface{}, d *schema.ResourceData, pre string) interface{} { @@ -175,7 +175,7 @@ func flattenSecurityconsoleAssignPackageTargetExcluded(v interface{}, d *schema. } func flattenSecurityconsoleAssignPackageTargetPkg(v interface{}, d *schema.ResourceData, pre string) interface{} { - return convintflist2str(v, d.Get(pre)) + return v } func refreshObjectSecurityconsoleAssignPackage(d *schema.ResourceData, o map[string]interface{}) error { @@ -243,7 +243,7 @@ func expandSecurityconsoleAssignPackageFlags(d *schema.ResourceData, v interface } func expandSecurityconsoleAssignPackagePkg(d *schema.ResourceData, v interface{}, pre string) (interface{}, error) { - return convstr2list(v, nil), nil + return v, nil } func expandSecurityconsoleAssignPackageTarget(d *schema.ResourceData, v interface{}, pre string) (interface{}, error) { @@ -286,7 +286,7 @@ func expandSecurityconsoleAssignPackageTarget(d *schema.ResourceData, v interfac } func expandSecurityconsoleAssignPackageTargetAdom(d *schema.ResourceData, v interface{}, pre string) (interface{}, error) { - return convstr2list(v, nil), nil + return v, nil } func expandSecurityconsoleAssignPackageTargetExcluded(d *schema.ResourceData, v interface{}, pre string) (interface{}, error) { @@ -294,7 +294,7 @@ func expandSecurityconsoleAssignPackageTargetExcluded(d *schema.ResourceData, v } func expandSecurityconsoleAssignPackageTargetPkg(d *schema.ResourceData, v interface{}, pre string) (interface{}, error) { - return convstr2list(v, nil), nil + return v, nil } func getObjectSecurityconsoleAssignPackage(d *schema.ResourceData) (*map[string]interface{}, error) { diff --git a/fmg/resource_securityconsole_install_device.go b/fmg/resource_securityconsole_install_device.go index 0668e4fd..3644e8da 100644 --- a/fmg/resource_securityconsole_install_device.go +++ b/fmg/resource_securityconsole_install_device.go @@ -112,7 +112,7 @@ func resourceSecurityconsoleInstallDeviceRead(d *schema.ResourceData, m interfac } func flattenSecurityconsoleInstallDeviceAdom(v interface{}, d *schema.ResourceData, pre string) interface{} { - return convintflist2str(v, d.Get(pre)) + return v } func flattenSecurityconsoleInstallDeviceDevRevComments(v interface{}, d *schema.ResourceData, pre string) interface{} { @@ -243,7 +243,7 @@ func flattenSecurityconsoleInstallDeviceFortiTestDebug(d *schema.ResourceData, f } func expandSecurityconsoleInstallDeviceAdom(d *schema.ResourceData, v interface{}, pre string) (interface{}, error) { - return convstr2list(v, nil), nil + return v, nil } func expandSecurityconsoleInstallDeviceDevRevComments(d *schema.ResourceData, v interface{}, pre string) (interface{}, error) { diff --git a/fmg/resource_securityconsole_install_objects_v2.go b/fmg/resource_securityconsole_install_objects_v2.go index 450e3e13..1ab1b748 100644 --- a/fmg/resource_securityconsole_install_objects_v2.go +++ b/fmg/resource_securityconsole_install_objects_v2.go @@ -112,7 +112,7 @@ func resourceSecurityconsoleInstallObjectsV2Read(d *schema.ResourceData, m inter } func flattenSecurityconsoleInstallObjectsV2Adom(v interface{}, d *schema.ResourceData, pre string) interface{} { - return convintflist2str(v, d.Get(pre)) + return v } func flattenSecurityconsoleInstallObjectsV2Category(v interface{}, d *schema.ResourceData, pre string) interface{} { @@ -243,7 +243,7 @@ func flattenSecurityconsoleInstallObjectsV2FortiTestDebug(d *schema.ResourceData } func expandSecurityconsoleInstallObjectsV2Adom(d *schema.ResourceData, v interface{}, pre string) (interface{}, error) { - return convstr2list(v, nil), nil + return v, nil } func expandSecurityconsoleInstallObjectsV2Category(d *schema.ResourceData, v interface{}, pre string) (interface{}, error) { diff --git a/fmg/resource_securityconsole_install_package.go b/fmg/resource_securityconsole_install_package.go index 3fef05d6..8d965acf 100644 --- a/fmg/resource_securityconsole_install_package.go +++ b/fmg/resource_securityconsole_install_package.go @@ -124,7 +124,7 @@ func resourceSecurityconsoleInstallPackageRead(d *schema.ResourceData, m interfa } func flattenSecurityconsoleInstallPackageAdom(v interface{}, d *schema.ResourceData, pre string) interface{} { - return convintflist2str(v, d.Get(pre)) + return v } func flattenSecurityconsoleInstallPackageAdomRevComments(v interface{}, d *schema.ResourceData, pre string) interface{} { @@ -144,7 +144,7 @@ func flattenSecurityconsoleInstallPackageFlags(v interface{}, d *schema.Resource } func flattenSecurityconsoleInstallPackagePkg(v interface{}, d *schema.ResourceData, pre string) interface{} { - return convintflist2str(v, d.Get(pre)) + return v } func flattenSecurityconsoleInstallPackageScope(v interface{}, d *schema.ResourceData, pre string) []map[string]interface{} { @@ -297,7 +297,7 @@ func flattenSecurityconsoleInstallPackageFortiTestDebug(d *schema.ResourceData, } func expandSecurityconsoleInstallPackageAdom(d *schema.ResourceData, v interface{}, pre string) (interface{}, error) { - return convstr2list(v, nil), nil + return v, nil } func expandSecurityconsoleInstallPackageAdomRevComments(d *schema.ResourceData, v interface{}, pre string) (interface{}, error) { @@ -317,7 +317,7 @@ func expandSecurityconsoleInstallPackageFlags(d *schema.ResourceData, v interfac } func expandSecurityconsoleInstallPackagePkg(d *schema.ResourceData, v interface{}, pre string) (interface{}, error) { - return convstr2list(v, nil), nil + return v, nil } func expandSecurityconsoleInstallPackageScope(d *schema.ResourceData, v interface{}, pre string) (interface{}, error) { diff --git a/fmg/resource_securityconsole_install_preview.go b/fmg/resource_securityconsole_install_preview.go index 3293d2e8..5cb405b3 100644 --- a/fmg/resource_securityconsole_install_preview.go +++ b/fmg/resource_securityconsole_install_preview.go @@ -97,7 +97,7 @@ func resourceSecurityconsoleInstallPreviewRead(d *schema.ResourceData, m interfa } func flattenSecurityconsoleInstallPreviewAdom(v interface{}, d *schema.ResourceData, pre string) interface{} { - return convintflist2str(v, d.Get(pre)) + return v } func flattenSecurityconsoleInstallPreviewDevice(v interface{}, d *schema.ResourceData, pre string) interface{} { @@ -165,7 +165,7 @@ func flattenSecurityconsoleInstallPreviewFortiTestDebug(d *schema.ResourceData, } func expandSecurityconsoleInstallPreviewAdom(d *schema.ResourceData, v interface{}, pre string) (interface{}, error) { - return convstr2list(v, nil), nil + return v, nil } func expandSecurityconsoleInstallPreviewDevice(d *schema.ResourceData, v interface{}, pre string) (interface{}, error) { diff --git a/fmg/resource_securityconsole_package_cancel_install.go b/fmg/resource_securityconsole_package_cancel_install.go index ed648b25..8f6dfe9e 100644 --- a/fmg/resource_securityconsole_package_cancel_install.go +++ b/fmg/resource_securityconsole_package_cancel_install.go @@ -81,7 +81,7 @@ func resourceSecurityconsolePackageCancelInstallRead(d *schema.ResourceData, m i } func flattenSecurityconsolePackageCancelInstallAdom(v interface{}, d *schema.ResourceData, pre string) interface{} { - return convintflist2str(v, d.Get(pre)) + return v } func refreshObjectSecurityconsolePackageCancelInstall(d *schema.ResourceData, o map[string]interface{}) error { @@ -107,7 +107,7 @@ func flattenSecurityconsolePackageCancelInstallFortiTestDebug(d *schema.Resource } func expandSecurityconsolePackageCancelInstallAdom(d *schema.ResourceData, v interface{}, pre string) (interface{}, error) { - return convstr2list(v, nil), nil + return v, nil } func getObjectSecurityconsolePackageCancelInstall(d *schema.ResourceData) (*map[string]interface{}, error) { diff --git a/fmg/resource_securityconsole_package_clone.go b/fmg/resource_securityconsole_package_clone.go index b39bb351..cfaec6ab 100644 --- a/fmg/resource_securityconsole_package_clone.go +++ b/fmg/resource_securityconsole_package_clone.go @@ -114,7 +114,7 @@ func resourceSecurityconsolePackageCloneRead(d *schema.ResourceData, m interface } func flattenSecurityconsolePackageCloneAdom(v interface{}, d *schema.ResourceData, pre string) interface{} { - return convintflist2str(v, d.Get(pre)) + return v } func flattenSecurityconsolePackageCloneDstName(v interface{}, d *schema.ResourceData, pre string) interface{} { @@ -126,7 +126,7 @@ func flattenSecurityconsolePackageCloneDstParent(v interface{}, d *schema.Resour } func flattenSecurityconsolePackageClonePkg(v interface{}, d *schema.ResourceData, pre string) interface{} { - return convintflist2str(v, d.Get(pre)) + return v } func flattenSecurityconsolePackageCloneScope(v interface{}, d *schema.ResourceData, pre string) []map[string]interface{} { @@ -259,7 +259,7 @@ func flattenSecurityconsolePackageCloneFortiTestDebug(d *schema.ResourceData, fo } func expandSecurityconsolePackageCloneAdom(d *schema.ResourceData, v interface{}, pre string) (interface{}, error) { - return convstr2list(v, nil), nil + return v, nil } func expandSecurityconsolePackageCloneDstName(d *schema.ResourceData, v interface{}, pre string) (interface{}, error) { @@ -271,7 +271,7 @@ func expandSecurityconsolePackageCloneDstParent(d *schema.ResourceData, v interf } func expandSecurityconsolePackageClonePkg(d *schema.ResourceData, v interface{}, pre string) (interface{}, error) { - return convstr2list(v, nil), nil + return v, nil } func expandSecurityconsolePackageCloneScope(d *schema.ResourceData, v interface{}, pre string) (interface{}, error) { diff --git a/fmg/resource_securityconsole_package_commit.go b/fmg/resource_securityconsole_package_commit.go index 341076c7..312d24a0 100644 --- a/fmg/resource_securityconsole_package_commit.go +++ b/fmg/resource_securityconsole_package_commit.go @@ -102,7 +102,7 @@ func resourceSecurityconsolePackageCommitRead(d *schema.ResourceData, m interfac } func flattenSecurityconsolePackageCommitAdom(v interface{}, d *schema.ResourceData, pre string) interface{} { - return convintflist2str(v, d.Get(pre)) + return v } func flattenSecurityconsolePackageCommitScope(v interface{}, d *schema.ResourceData, pre string) []map[string]interface{} { @@ -205,7 +205,7 @@ func flattenSecurityconsolePackageCommitFortiTestDebug(d *schema.ResourceData, f } func expandSecurityconsolePackageCommitAdom(d *schema.ResourceData, v interface{}, pre string) (interface{}, error) { - return convstr2list(v, nil), nil + return v, nil } func expandSecurityconsolePackageCommitScope(d *schema.ResourceData, v interface{}, pre string) (interface{}, error) { diff --git a/fmg/resource_securityconsole_package_move.go b/fmg/resource_securityconsole_package_move.go index c76f737b..98ecfc04 100644 --- a/fmg/resource_securityconsole_package_move.go +++ b/fmg/resource_securityconsole_package_move.go @@ -93,7 +93,7 @@ func resourceSecurityconsolePackageMoveRead(d *schema.ResourceData, m interface{ } func flattenSecurityconsolePackageMoveAdom(v interface{}, d *schema.ResourceData, pre string) interface{} { - return convintflist2str(v, d.Get(pre)) + return v } func flattenSecurityconsolePackageMoveDstName(v interface{}, d *schema.ResourceData, pre string) interface{} { @@ -105,7 +105,7 @@ func flattenSecurityconsolePackageMoveDstParent(v interface{}, d *schema.Resourc } func flattenSecurityconsolePackageMovePkg(v interface{}, d *schema.ResourceData, pre string) interface{} { - return convintflist2str(v, d.Get(pre)) + return v } func refreshObjectSecurityconsolePackageMove(d *schema.ResourceData, o map[string]interface{}) error { @@ -161,7 +161,7 @@ func flattenSecurityconsolePackageMoveFortiTestDebug(d *schema.ResourceData, fos } func expandSecurityconsolePackageMoveAdom(d *schema.ResourceData, v interface{}, pre string) (interface{}, error) { - return convstr2list(v, nil), nil + return v, nil } func expandSecurityconsolePackageMoveDstName(d *schema.ResourceData, v interface{}, pre string) (interface{}, error) { @@ -173,7 +173,7 @@ func expandSecurityconsolePackageMoveDstParent(d *schema.ResourceData, v interfa } func expandSecurityconsolePackageMovePkg(d *schema.ResourceData, v interface{}, pre string) (interface{}, error) { - return convstr2list(v, nil), nil + return v, nil } func getObjectSecurityconsolePackageMove(d *schema.ResourceData) (*map[string]interface{}, error) { diff --git a/fmg/resource_securityconsole_pblock_clone.go b/fmg/resource_securityconsole_pblock_clone.go index 52047df9..c2423ea7 100644 --- a/fmg/resource_securityconsole_pblock_clone.go +++ b/fmg/resource_securityconsole_pblock_clone.go @@ -89,7 +89,7 @@ func resourceSecurityconsolePblockCloneRead(d *schema.ResourceData, m interface{ } func flattenSecurityconsolePblockCloneAdom(v interface{}, d *schema.ResourceData, pre string) interface{} { - return convintflist2str(v, d.Get(pre)) + return v } func flattenSecurityconsolePblockCloneDstName(v interface{}, d *schema.ResourceData, pre string) interface{} { @@ -143,7 +143,7 @@ func flattenSecurityconsolePblockCloneFortiTestDebug(d *schema.ResourceData, fos } func expandSecurityconsolePblockCloneAdom(d *schema.ResourceData, v interface{}, pre string) (interface{}, error) { - return convstr2list(v, nil), nil + return v, nil } func expandSecurityconsolePblockCloneDstName(d *schema.ResourceData, v interface{}, pre string) (interface{}, error) { diff --git a/fmg/resource_securityconsole_reinstall_package.go b/fmg/resource_securityconsole_reinstall_package.go index 65599556..4744e4e9 100644 --- a/fmg/resource_securityconsole_reinstall_package.go +++ b/fmg/resource_securityconsole_reinstall_package.go @@ -120,7 +120,7 @@ func resourceSecurityconsoleReinstallPackageRead(d *schema.ResourceData, m inter } func flattenSecurityconsoleReinstallPackageAdom(v interface{}, d *schema.ResourceData, pre string) interface{} { - return convintflist2str(v, d.Get(pre)) + return v } func flattenSecurityconsoleReinstallPackageFlags(v interface{}, d *schema.ResourceData, pre string) interface{} { @@ -169,7 +169,7 @@ func flattenSecurityconsoleReinstallPackageTarget(v interface{}, d *schema.Resou } func flattenSecurityconsoleReinstallPackageTargetPkg(v interface{}, d *schema.ResourceData, pre string) interface{} { - return convintflist2str(v, d.Get(pre)) + return v } func flattenSecurityconsoleReinstallPackageTargetScope(v interface{}, d *schema.ResourceData, pre string) []map[string]interface{} { @@ -282,7 +282,7 @@ func flattenSecurityconsoleReinstallPackageFortiTestDebug(d *schema.ResourceData } func expandSecurityconsoleReinstallPackageAdom(d *schema.ResourceData, v interface{}, pre string) (interface{}, error) { - return convstr2list(v, nil), nil + return v, nil } func expandSecurityconsoleReinstallPackageFlags(d *schema.ResourceData, v interface{}, pre string) (interface{}, error) { @@ -329,7 +329,7 @@ func expandSecurityconsoleReinstallPackageTarget(d *schema.ResourceData, v inter } func expandSecurityconsoleReinstallPackageTargetPkg(d *schema.ResourceData, v interface{}, pre string) (interface{}, error) { - return convstr2list(v, nil), nil + return v, nil } func expandSecurityconsoleReinstallPackageTargetScope(d *schema.ResourceData, v interface{}, pre string) (interface{}, error) { diff --git a/fmg/resource_securityconsole_sign_certificate_template.go b/fmg/resource_securityconsole_sign_certificate_template.go index 63e94d04..e7ef6d6c 100644 --- a/fmg/resource_securityconsole_sign_certificate_template.go +++ b/fmg/resource_securityconsole_sign_certificate_template.go @@ -106,7 +106,7 @@ func resourceSecurityconsoleSignCertificateTemplateRead(d *schema.ResourceData, } func flattenSecurityconsoleSignCertificateTemplateAdom(v interface{}, d *schema.ResourceData, pre string) interface{} { - return convintflist2str(v, d.Get(pre)) + return v } func flattenSecurityconsoleSignCertificateTemplateScope(v interface{}, d *schema.ResourceData, pre string) []map[string]interface{} { @@ -223,7 +223,7 @@ func flattenSecurityconsoleSignCertificateTemplateFortiTestDebug(d *schema.Resou } func expandSecurityconsoleSignCertificateTemplateAdom(d *schema.ResourceData, v interface{}, pre string) (interface{}, error) { - return convstr2list(v, nil), nil + return v, nil } func expandSecurityconsoleSignCertificateTemplateScope(d *schema.ResourceData, v interface{}, pre string) (interface{}, error) { diff --git a/fmg/resource_securityconsole_template_cli_preview.go b/fmg/resource_securityconsole_template_cli_preview.go index d1a1e571..0dfeef7c 100644 --- a/fmg/resource_securityconsole_template_cli_preview.go +++ b/fmg/resource_securityconsole_template_cli_preview.go @@ -110,7 +110,7 @@ func resourceSecurityconsoleTemplateCliPreviewRead(d *schema.ResourceData, m int } func flattenSecurityconsoleTemplateCliPreviewAdom(v interface{}, d *schema.ResourceData, pre string) interface{} { - return convintflist2str(v, d.Get(pre)) + return v } func flattenSecurityconsoleTemplateCliPreviewFilename(v interface{}, d *schema.ResourceData, pre string) interface{} { @@ -118,7 +118,7 @@ func flattenSecurityconsoleTemplateCliPreviewFilename(v interface{}, d *schema.R } func flattenSecurityconsoleTemplateCliPreviewPkg(v interface{}, d *schema.ResourceData, pre string) interface{} { - return convintflist2str(v, d.Get(pre)) + return v } func flattenSecurityconsoleTemplateCliPreviewScope(v interface{}, d *schema.ResourceData, pre string) []map[string]interface{} { @@ -241,7 +241,7 @@ func flattenSecurityconsoleTemplateCliPreviewFortiTestDebug(d *schema.ResourceDa } func expandSecurityconsoleTemplateCliPreviewAdom(d *schema.ResourceData, v interface{}, pre string) (interface{}, error) { - return convstr2list(v, nil), nil + return v, nil } func expandSecurityconsoleTemplateCliPreviewFilename(d *schema.ResourceData, v interface{}, pre string) (interface{}, error) { @@ -249,7 +249,7 @@ func expandSecurityconsoleTemplateCliPreviewFilename(d *schema.ResourceData, v i } func expandSecurityconsoleTemplateCliPreviewPkg(d *schema.ResourceData, v interface{}, pre string) (interface{}, error) { - return convstr2list(v, nil), nil + return v, nil } func expandSecurityconsoleTemplateCliPreviewScope(d *schema.ResourceData, v interface{}, pre string) (interface{}, error) { diff --git a/fmg/resource_system_csf.go b/fmg/resource_system_csf.go index 6ca909ac..bd9df579 100644 --- a/fmg/resource_system_csf.go +++ b/fmg/resource_system_csf.go @@ -172,6 +172,7 @@ func resourceSystemCsf() *schema.Resource { "index": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "name": &schema.Schema{ Type: schema.TypeString, diff --git a/fmg/resource_system_ntp.go b/fmg/resource_system_ntp.go index ee6c0979..10a152c3 100644 --- a/fmg/resource_system_ntp.go +++ b/fmg/resource_system_ntp.go @@ -42,6 +42,7 @@ func resourceSystemNtp() *schema.Resource { "id": &schema.Schema{ Type: schema.TypeInt, Optional: true, + Computed: true, }, "key": &schema.Schema{ Type: schema.TypeSet, diff --git a/fmg/resource_system_ntp_ntpserver.go b/fmg/resource_system_ntp_ntpserver.go index 11cdc8c1..88caaae9 100644 --- a/fmg/resource_system_ntp_ntpserver.go +++ b/fmg/resource_system_ntp_ntpserver.go @@ -38,6 +38,7 @@ func resourceSystemNtpNtpserver() *schema.Resource { Type: schema.TypeInt, ForceNew: true, Optional: true, + Computed: true, }, "key": &schema.Schema{ Type: schema.TypeSet, @@ -86,12 +87,21 @@ func resourceSystemNtpNtpserverCreate(d *schema.ResourceData, m interface{}) err return fmt.Errorf("Error creating SystemNtpNtpserver resource while getting object: %v", err) } - _, err = c.CreateSystemNtpNtpserver(obj, paradict) + v, err := c.CreateSystemNtpNtpserver(obj, paradict) if err != nil { return fmt.Errorf("Error creating SystemNtpNtpserver resource: %v", err) } + if v != nil && v["id"] != nil { + if vidn, ok := v["id"].(float64); ok { + d.SetId(strconv.Itoa(int(vidn))) + return resourceSystemNtpNtpserverRead(d, m) + } else { + return fmt.Errorf("Error creating SystemNtpNtpserver resource: %v", err) + } + } + d.SetId(strconv.Itoa(getIntKey(d, "fosid"))) return resourceSystemNtpNtpserverRead(d, m) diff --git a/fmg/resource_systemp_log_syslogd_filter.go b/fmg/resource_systemp_log_syslogd_filter.go index 7249ae54..20619fa7 100644 --- a/fmg/resource_systemp_log_syslogd_filter.go +++ b/fmg/resource_systemp_log_syslogd_filter.go @@ -127,6 +127,7 @@ func resourceSystempLogSyslogdFilter() *schema.Resource { "category": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "filter": &schema.Schema{ Type: schema.TypeString, @@ -135,6 +136,7 @@ func resourceSystempLogSyslogdFilter() *schema.Resource { "filter_type": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "id": &schema.Schema{ Type: schema.TypeInt, diff --git a/fmg/resource_systemp_system_ntp.go b/fmg/resource_systemp_system_ntp.go index c61f6601..34eb846e 100644 --- a/fmg/resource_systemp_system_ntp.go +++ b/fmg/resource_systemp_system_ntp.go @@ -120,6 +120,7 @@ func resourceSystempSystemNtp() *schema.Resource { "ntpv3": &schema.Schema{ Type: schema.TypeString, Optional: true, + Computed: true, }, "server": &schema.Schema{ Type: schema.TypeString, diff --git a/go.mod b/go.mod index e9109a8b..50eeb187 100644 --- a/go.mod +++ b/go.mod @@ -4,23 +4,23 @@ go 1.21 require ( github.com/google/uuid v1.6.0 - github.com/hashicorp/terraform-plugin-sdk/v2 v2.33.0 + github.com/hashicorp/terraform-plugin-sdk/v2 v2.34.0 ) require ( github.com/agext/levenshtein v1.2.2 // indirect github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect github.com/fatih/color v1.16.0 // indirect - github.com/golang/protobuf v1.5.3 // indirect + github.com/golang/protobuf v1.5.4 // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 // indirect github.com/hashicorp/go-hclog v1.5.0 // indirect github.com/hashicorp/go-plugin v1.6.0 // indirect github.com/hashicorp/go-uuid v1.0.3 // indirect github.com/hashicorp/go-version v1.6.0 // indirect - github.com/hashicorp/hcl/v2 v2.19.1 // indirect + github.com/hashicorp/hcl/v2 v2.20.1 // indirect github.com/hashicorp/logutils v1.0.0 // indirect - github.com/hashicorp/terraform-plugin-go v0.22.0 // indirect + github.com/hashicorp/terraform-plugin-go v0.23.0 // indirect github.com/hashicorp/terraform-plugin-log v0.9.0 // indirect github.com/hashicorp/terraform-registry-address v0.2.3 // indirect github.com/hashicorp/terraform-svchost v0.1.1 // indirect @@ -36,12 +36,14 @@ require ( github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect - github.com/zclconf/go-cty v1.14.2 // indirect - golang.org/x/net v0.19.0 // indirect - golang.org/x/sys v0.17.0 // indirect - golang.org/x/text v0.14.0 // indirect + github.com/zclconf/go-cty v1.14.4 // indirect + golang.org/x/mod v0.16.0 // indirect + golang.org/x/net v0.23.0 // indirect + golang.org/x/sys v0.20.0 // indirect + golang.org/x/text v0.15.0 // indirect + golang.org/x/tools v0.13.0 // indirect google.golang.org/appengine v1.6.8 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect - google.golang.org/grpc v1.61.1 // indirect - google.golang.org/protobuf v1.32.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/grpc v1.63.2 // indirect + google.golang.org/protobuf v1.34.0 // indirect ) diff --git a/go.sum b/go.sum index e54448fd..65c71aee 100644 --- a/go.sum +++ b/go.sum @@ -16,8 +16,8 @@ github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3a github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= @@ -34,16 +34,16 @@ github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/C github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/hcl/v2 v2.19.1 h1://i05Jqznmb2EXqa39Nsvyan2o5XyMowW5fnCKW5RPI= -github.com/hashicorp/hcl/v2 v2.19.1/go.mod h1:ThLC89FV4p9MPW804KVbe/cEXoQ8NZEh+JtMeeGErHE= +github.com/hashicorp/hcl/v2 v2.20.1 h1:M6hgdyz7HYt1UN9e61j+qKJBqR3orTWbI1HKBJEdxtc= +github.com/hashicorp/hcl/v2 v2.20.1/go.mod h1:TZDqQ4kNKCbh1iJp99FdPiUaVDDUPivbqxZulxDYqL4= github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/terraform-plugin-go v0.22.0 h1:1OS1Jk5mO0f5hrziWJGXXIxBrMe2j/B8E+DVGw43Xmc= -github.com/hashicorp/terraform-plugin-go v0.22.0/go.mod h1:mPULV91VKss7sik6KFEcEu7HuTogMLLO/EvWCuFkRVE= +github.com/hashicorp/terraform-plugin-go v0.23.0 h1:AALVuU1gD1kPb48aPQUjug9Ir/125t+AAurhqphJ2Co= +github.com/hashicorp/terraform-plugin-go v0.23.0/go.mod h1:1E3Cr9h2vMlahWMbsSEcNrOCxovCZhOOIXjFHbjc/lQ= github.com/hashicorp/terraform-plugin-log v0.9.0 h1:i7hOA+vdAItN1/7UrfBqBwvYPQ9TFvymaRGZED3FCV0= github.com/hashicorp/terraform-plugin-log v0.9.0/go.mod h1:rKL8egZQ/eXSyDqzLUuwUYLVdlYeamldAHSxjUFADow= -github.com/hashicorp/terraform-plugin-sdk/v2 v2.33.0 h1:qHprzXy/As0rxedphECBEQAh3R4yp6pKksKHcqZx5G8= -github.com/hashicorp/terraform-plugin-sdk/v2 v2.33.0/go.mod h1:H+8tjs9TjV2w57QFVSMBQacf8k/E1XwLXGCARgViC6A= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.34.0 h1:kJiWGx2kiQVo97Y5IOGR4EMcZ8DtMswHhUuFibsCQQE= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.34.0/go.mod h1:sl/UoabMc37HA6ICVMmGO+/0wofkVIRxf+BMb/dnoIg= github.com/hashicorp/terraform-registry-address v0.2.3 h1:2TAiKJ1A3MAkZlH1YI/aTVcLZRu7JseiXNRHbOAyoTI= github.com/hashicorp/terraform-registry-address v0.2.3/go.mod h1:lFHA76T8jfQteVfT7caREqguFrW3c4MFSPhZB7HHgUM= github.com/hashicorp/terraform-svchost v0.1.1 h1:EZZimZ1GxdqFRinZ1tpJwVxxt49xc/S52uzrw4x0jKQ= @@ -57,8 +57,6 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= @@ -93,20 +91,26 @@ github.com/vmihailenco/msgpack/v5 v5.4.1/go.mod h1:GaZTsDaehaPpQVyxrf5mtQlH+pc21 github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/zclconf/go-cty v1.14.2 h1:kTG7lqmBou0Zkx35r6HJHUQTvaRPr5bIAf3AoHS0izI= -github.com/zclconf/go-cty v1.14.2/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= +github.com/zclconf/go-cty v1.14.4 h1:uXXczd9QDGsgu0i/QFR/hzI5NYCHLf6NQw/atrbnhq8= +github.com/zclconf/go-cty v1.14.4/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= +github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b h1:FosyBZYxY34Wul7O/MSKey3txpPYyCqVO5ZyceuQJEI= +github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b/go.mod h1:ZRKQfBXbGkpdV6QMzT3rU1kSTAnfu1dO8dPKjYprgj8= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.16.0 h1:QX4fJ0Rr5cPQCF7O9lh9Se4pmwfwskqZfq5moyldzic= +golang.org/x/mod v0.16.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= -golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= +golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= +golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= +golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -119,8 +123,8 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -128,24 +132,26 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= +golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ= +golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 h1:Jyp0Hsi0bmHXG6k9eATXoYtjd6e2UzZ1SCn/wIupY14= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:oQ5rr10WTTMvP4A36n8JpR1OrO1BEiV4f78CneXZxkA= -google.golang.org/grpc v1.61.1 h1:kLAiWrZs7YeDM6MumDe7m3y4aM6wacLzM1Y/wiLP9XY= -google.golang.org/grpc v1.61.1/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de h1:cZGRis4/ot9uVm639a+rHCUaG0JJHEsdyzSQTMX+suY= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= +google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= -google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.0 h1:Qo/qEd2RZPCf2nKuorzksSknv0d3ERwp1vFG38gSmH4= +google.golang.org/protobuf v1.34.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/sdk/sdkcore/sdkfos.go b/sdk/sdkcore/sdkfos.go index dbe58b17..d0dbe58d 100644 --- a/sdk/sdkcore/sdkfos.go +++ b/sdk/sdkcore/sdkfos.go @@ -168,72 +168,6 @@ func (c *FortiSDKClient) ReadDvmdbAdom(mkey string, paradict map[string]string) return } -// CreateDvmdbDeviceVdom API operation for FortiManager creates a new DeviceVdom. -// Returns the index value of the DeviceVdom and execution result when the request executes successfully. -// Returns error for service API and SDK errors. -// See the dvmdb - device vdom chapter in the FortiManager Handbook - CLI Reference. -func (c *FortiSDKClient) CreateDvmdbDeviceVdom(params *map[string]interface{}, paradict map[string]string) (output map[string]interface{}, err error) { - path := "/dvmdb/[*]/device/{device}/vdom" - path, err = replaceParaWithValue(path, paradict) - if err != nil { - return nil, fmt.Errorf("%v", err) - } - - output, err = createUpdate(c, path, "add", params, false) - return -} - -// UpdateDvmdbDeviceVdom API operation for FortiManager updates the specified DeviceVdom. -// Returns the index value of the DeviceVdom and execution result when the request executes successfully. -// Returns error for service API and SDK errors. -// See the dvmdb - device vdom chapter in the FortiManager Handbook - CLI Reference. -func (c *FortiSDKClient) UpdateDvmdbDeviceVdom(params *map[string]interface{}, mkey string, paradict map[string]string) (output map[string]interface{}, err error) { - path := "/dvmdb/[*]/device/{device}/vdom" - path, err = replaceParaWithValue(path, paradict) - if err != nil { - return nil, fmt.Errorf("%v", err) - } - - path += "/" + escapeURLString(mkey) - - output, err = createUpdate(c, path, "set", params, false) - return -} - -// DeleteDvmdbDeviceVdom API operation for FortiManager deletes the specified DeviceVdom. -// Returns error for service API and SDK errors. -// See the dvmdb - device vdom chapter in the FortiManager Handbook - CLI Reference. -func (c *FortiSDKClient) DeleteDvmdbDeviceVdom(mkey string, paradict map[string]string) (err error) { - path := "/dvmdb/[*]/device/{device}/vdom" - path, err = replaceParaWithValue(path, paradict) - if err != nil { - return fmt.Errorf("%v", err) - } - - path += "/" + escapeURLString(mkey) - - err = delete(c, path, "delete", false) - return -} - -// ReadDvmdbDeviceVdom API operation for FortiManager gets the DeviceVdom -// with the specified index value. -// Returns the requested DeviceVdom value when the request executes successfully. -// Returns error for service API and SDK errors. -// See the dvmdb - device vdom chapter in the FortiManager Handbook - CLI Reference. -func (c *FortiSDKClient) ReadDvmdbDeviceVdom(mkey string, paradict map[string]string) (mapTmp map[string]interface{}, err error) { - path := "/dvmdb/[*]/device/{device}/vdom" - path, err = replaceParaWithValue(path, paradict) - if err != nil { - return nil, fmt.Errorf("%v", err) - } - - path += "/" + escapeURLString(mkey) - - mapTmp, err = read(c, path, "get", false) - return -} - // CreateDvmdbGroup API operation for FortiManager creates a new Group. // Returns the index value of the Group and execution result when the request executes successfully. // Returns error for service API and SDK errors. diff --git a/sdk/sdkcore/sdkutils.go b/sdk/sdkcore/sdkutils.go index f5790f2d..208da790 100644 --- a/sdk/sdkcore/sdkutils.go +++ b/sdk/sdkcore/sdkutils.go @@ -267,7 +267,7 @@ func fortiAPIErrorFormat(result map[string]interface{}, body string) (code int, v := result["result"] l := v.([]interface{}) - if len(l) > 0 || l[0] != nil { + if len(l) > 0 && l[0] != nil { v2 := l[0].(map[string]interface{}) if v2["status"] != nil { v3 := v2["status"].(map[string]interface{}) diff --git a/website/docs/r/fortimanager_dvmdb_device_vdom.html.markdown b/website/docs/r/fortimanager_dvmdb_device_vdom.html.markdown deleted file mode 100644 index 7ec3732f..00000000 --- a/website/docs/r/fortimanager_dvmdb_device_vdom.html.markdown +++ /dev/null @@ -1,52 +0,0 @@ ---- -subcategory: "No Category" -layout: "fortimanager" -page_title: "FortiManager: fortimanager_dvmdb_device_vdom" -description: |- - Device VDOM table. ---- - -# fortimanager_dvmdb_device_vdom -Device VDOM table. - -~> This resource is a sub resource for variable `vdom` of resource `fortimanager_dvmdb_device`. Conflict and overwrite may occur if use both of them. - - - -## Argument Reference - - -The following arguments are supported: - -* `scopetype` - The scope of application of the resource. Valid values: `inherit`, `adom`. The `inherit` means that the scopetype of the provider will be inherited, and adom will also be inherited. The default value is `inherit`. -* `adom` - Adom. This value is valid only when the `scopetype` is `adom`, otherwise the value of adom in the provider will be inherited. -* `device_name` - FortiManager managed device name. This variable is used in the request URL. - -* `comments` - Comments. -* `metafields` - Meta Fields. -* `name` - Name. -* `opmode` - Opmode. Valid values: `nat`, `transparent`. - -* `rtm_prof_id` - Rtm_Prof_Id. -* `status` - Status. -* `vdom_type` - Vdom_Type. Valid values: `traffic`, `admin`. - -* `vpn_id` - Vpn_Id. - - -## Attribute Reference - -In addition to all the above arguments, the following attributes are exported: -* `id` - an identifier for the resource with format {{name}}. - -## Import - -Dvmdb DeviceVdom can be imported using any of these accepted formats: -``` -Set import_options = ["device=YOUR_VALUE"] in the provider section. - -$ export "FORTIMANAGER_IMPORT_TABLE"="true" -$ terraform import fortimanager_dvmdb_device_vdom.labelname {{name}} -$ unset "FORTIMANAGER_IMPORT_TABLE" -``` --> **Hint:** The scopetype and adom for import will directly inherit the scopetype and adom configuration of the provider.