code: func StateValueToJSONMap(val cty.Value, ty cty.Type) (map[string]interface{}, error) {
  	js, err := ctyjson.Marshal(val, ty)
  	if err != nil {
  		return nil, err
  	}
  
  	var m map[string]interface{}
  	if err := json.Unmarshal(js, &m); err != nil {
  		return nil, err
  	}
  
  	return m, nil
  }
docs: // StateValueToJSONMap converts a cty.Value to generic JSON map via the cty JSON
  // encoding.