code: func ObjectValueID(obj cty.Value) (k, v string) {
  	if obj.IsNull() || !obj.IsKnown() {
  		return "", ""
  	}
  
  	atys := obj.Type().AttributeTypes()
  
  	switch {
  
  	case atys["id"] == cty.String:
  		v := obj.GetAttr("id")
  		if v.IsKnown() && !v.IsNull() {
  			return "id", v.AsString()
  		}
  
  	case atys["name"] == cty.String:
  		// "name" isn't always globally unique, but if there isn't also an
  		// "id" then it _often_ is, in practice.
  		v := obj.GetAttr("name")
  		if v.IsKnown() && !v.IsNull() {
  			return "name", v.AsString()
  		}
  	}
  
  	return "", ""
  }
docs: // ObjectValueID takes a value that is assumed to be an object representation
  // of some resource instance object and attempts to heuristically find an
  // attribute of it that is likely to be a unique identifier in the remote
  // system that it belongs to which will be useful to the user.
  //
  // If such an attribute is found, its name and string value intended for
  // display are returned. Both returned strings are empty if no such attribute
  // exists, in which case the caller should assume that the resource instance
  // address within the Terraform configuration is the best available identifier.
  //
  // This is only a best-effort sort of thing, relying on naming conventions in
  // our resource type schemas. The result is not guaranteed to be unique, but
  // should generally be suitable for display to an end-user anyway.
  //
  // This function will panic if the given value is not of an object type.