diff --git a/constellix/resource_constellix_txt_record.go b/constellix/resource_constellix_txt_record.go index f9e55d5..a4571bc 100644 --- a/constellix/resource_constellix_txt_record.go +++ b/constellix/resource_constellix_txt_record.go @@ -86,7 +86,7 @@ func resourceConstellixTxt() *schema.Resource { }, "roundrobin": &schema.Schema{ - Type: schema.TypeSet, + Type: schema.TypeList, Required: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ @@ -197,7 +197,7 @@ func resourceConstellixTxtCreate(d *schema.ResourceData, m interface{}) error { if rr, ok := d.GetOk("roundrobin"); ok { mapListRR := make([]interface{}, 0, 1) - tp := rr.(*schema.Set).List() + tp := rr.([]interface{}) for _, val := range tp { tpMap := make(map[string]interface{}) inner := val.(map[string]interface{}) @@ -272,7 +272,7 @@ func resourceConstellixTxtUpdate(d *schema.ResourceData, m interface{}) error { } if rr, ok := d.GetOk("roundrobin"); ok { mapListRR := make([]interface{}, 0, 1) - tp := rr.(*schema.Set).List() + tp := rr.([]interface{}) for _, val := range tp { tpMap := make(map[string]interface{}) inner := val.(map[string]interface{}) @@ -331,7 +331,9 @@ func resourceConstellixTxtRead(d *schema.ResourceData, m interface{}) error { for _, val := range resrr { tpMap := make(map[string]interface{}) inner := val.(map[string]interface{}) - tpMap["value"] = stripQuotes(inner["value"].(string)) // removing the quotes added by the server during the GET call + value := stripQuotes(inner["value"].(string)) + value = strings.ReplaceAll(value, "\" \"", "") + tpMap["value"] = value tpMap["disable_flag"] = inner["disableFlag"].(bool) mapListRR = append(mapListRR, tpMap) }