Computed Type list showing change when not setting

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.


@jbardin @apparentlymart

Hi @ramuklawjju,

The status of known after apply would not directly be because of the Read method, an attribute being marked as unknown is only something that can be done during the plan after the resource has been refreshed.

This looks like an SDK derived schema, are you adding any other CustomizeDiff options? Someone who works more closely with providers may have a guess, but I would need a more complete example to be able to tell what’s going on.