code: func stringMapFromValue(val cty.Value) map[string]string {
  	m := map[string]string{}
  	if val.IsNull() || !val.IsKnown() {
  		return m
  	}
  
  	for it := val.ElementIterator(); it.Next(); {
  		ak, av := it.Element()
  		name := ak.AsString()
  
  		if !av.IsKnown() || av.IsNull() {
  			continue
  		}
  
  		av, _ = ctyconvert.Convert(av, cty.String)
  		m[name] = av.AsString()
  	}
  
  	return m
  }
docs: // stringMapFromValue converts a cty.Value to a map[stirng]string.
  // This will panic if the val is not a cty.Map(cty.String).