code: func (u *ResourceCommand) createTrustedCluster(client auth.ClientI, raw services.UnknownResource) error {
  	tc, err := services.GetTrustedClusterMarshaler().Unmarshal(raw.Raw)
  	if err != nil {
  		return trace.Wrap(err)
  	}
  
  	// check if such cluster already exists:
  	name := tc.GetName()
  	_, err = client.GetTrustedCluster(name)
  	if err != nil && !trace.IsNotFound(err) {
  		return trace.Wrap(err)
  	}
  	exists := (err == nil)
  	if u.force == false && exists {
  		return trace.AlreadyExists("trusted cluster '%s' already exists", name)
  	}
  
  	out, err := client.UpsertTrustedCluster(tc)
  	if err != nil {
  		// If force is used and UpsertTrustedCluster returns trace.AlreadyExists,
  		// this means the user tried to upsert a cluster whose exact match already
  		// exists in the backend, nothing needs to occur other than happy message
  		// that the trusted cluster has been created.
  		if u.force && trace.IsAlreadyExists(err) {
  			out = tc
  		} else {
  			return trace.Wrap(err)
  		}
  	}
  	if out.GetName() != tc.GetName() {
  		fmt.Printf("WARNING: trusted cluster %q resource has been renamed to match remote cluster name %q\n", name, out.GetName())
  	}
  	fmt.Printf("trusted cluster %q has been %v\n", out.GetName(), UpsertVerb(exists, u.force))
  	return nil
  }
docs: // createTrustedCluster implements `tctl create cluster.yaml` command