code: func parseConnectionInfo(s *terraform.InstanceState) (*connectionInfo, error) {
  	connInfo := &connectionInfo{}
  	decConf := &mapstructure.DecoderConfig{
  		WeaklyTypedInput: true,
  		Result:           connInfo,
  	}
  	dec, err := mapstructure.NewDecoder(decConf)
  	if err != nil {
  		return nil, err
  	}
  	if err := dec.Decode(s.Ephemeral.ConnInfo); err != nil {
  		return nil, err
  	}
  
  	// Check on script paths which point to the default Windows TEMP folder because files
  	// which are put in there very early in the boot process could get cleaned/deleted
  	// before you had the change to execute them.
  	//
  	// TODO (SvH) Needs some more debugging to fully understand the exact sequence of events
  	// causing this...
  	if strings.HasPrefix(filepath.ToSlash(connInfo.ScriptPath), "C:/Windows/Temp") {
  		return nil, fmt.Errorf(
  			`Using the C:\Windows\Temp folder is not supported. Please use a different 'script_path'.`)
  	}
  
  	if connInfo.User == "" {
  		connInfo.User = DefaultUser
  	}
  
  	// Format the host if needed.
  	// Needed for IPv6 support.
  	connInfo.Host = shared.IpFormat(connInfo.Host)
  
  	if connInfo.Port == 0 {
  		if connInfo.HTTPS {
  			connInfo.Port = DefaultHTTPSPort
  		} else {
  			connInfo.Port = DefaultPort
  		}
  	}
  	if connInfo.ScriptPath == "" {
  		connInfo.ScriptPath = DefaultScriptPath
  	}
  	if connInfo.Timeout != "" {
  		connInfo.TimeoutVal = safeDuration(connInfo.Timeout, DefaultTimeout)
  	} else {
  		connInfo.TimeoutVal = DefaultTimeout
  	}
  
  	return connInfo, nil
  }
docs: // parseConnectionInfo is used to convert the ConnInfo of the InstanceState into
  // a ConnectionInfo struct