code: func Expand(m map[string]string, key string) interface{} {
  	// If the key is exactly a key in the map, just return it
  	if v, ok := m[key]; ok {
  		if v == "true" {
  			return true
  		} else if v == "false" {
  			return false
  		}
  
  		return v
  	}
  
  	// Check if the key is an array, and if so, expand the array
  	if v, ok := m[key+".#"]; ok {
  		// If the count of the key is unknown, then just put the unknown
  		// value in the value itself. This will be detected by Terraform
  		// core later.
  		if v == hil.UnknownValue {
  			return v
  		}
  
  		return expandArray(m, key)
  	}
  
  	// Check if this is a prefix in the map
  	prefix := key + "."
  	for k := range m {
  		if strings.HasPrefix(k, prefix) {
  			return expandMap(m, prefix)
  		}
  	}
  
  	return nil
  }
docs: // Expand takes a map and a key (prefix) and expands that value into
  // a more complex structure. This is the reverse of the Flatten operation.