I have a schema like this
"groups": {
Type: schema.TypeList,
Computed: true,
Description: "The group details",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"name": {
Type: schema.TypeString,
Computed: true,
Description: "The name of the group",
},
"url": {
Type: schema.TypeString,
Computed: true,
Description: "The url of the group",
},
},
},
},
And in the read method
if res.groups != nil {
groupList := make([]map[string]interface{}, 0)
for _, group := range res.groups {
currentgrp := map[string]interface{}{}
currentgrp["name"] = *group.Name
currentgrp["url"] = *group.Url
groupList = append(groupList, currentgrp)
}
d.Set("groups", groupList)
}
when the field is empty,
I am getting a change on terraform plan
+ groups = (known after apply)
# (19 unchanged attributes hidden)
}
Plan: 0 to add, 1 to change, 0 to destroy.