code: func New(s *terraform.InstanceState) (Communicator, error) {
  	connType := s.Ephemeral.ConnInfo["type"]
  	switch connType {
  	case "ssh", "": // The default connection type is ssh, so if connType is empty use ssh
  		return ssh.New(s)
  	case "winrm":
  		return winrm.New(s)
  	default:
  		return nil, fmt.Errorf("connection type '%s' not supported", connType)
  	}
  }
docs: // New returns a configured Communicator or an error if the connection type is not supported