func ParseResourceIdentifier(resourceID string) (*ResourceIdentifier, error) {
	var r ResourceIdentifier
	parts := strings.Split(resourceID, "+")
	if len(parts) < 4 {
		return &r, fmt.Errorf("Unable to parse input to resource identifier:%s", resourceID)
	}
	r.ServiceName = parts[0]
	r.DeploymentID = parts[1]
	r.ResourceType = parts[2]
	r.ResourceID = parts[3]
	if len(parts) < 5 {  
		log.Printf("ParseResourceIdentifier: r:%+v", r)
		return &r, nil
	}
	if parts[4] == "mongodb" {  
		ps := strings.Join(parts[4:], "+")
		p, err := ParseResourceIdentifier(ps)
		if err != nil {
			return &r, fmt.Errorf("Error parsing resource id:%+v", err)
		}
		r.Parent = p
	} else {  
		r.Parent = &ResourceIdentifier{
			ResourceType: parts[4],
			ResourceID:   parts[5],
		}
	}
	log.Printf("ParseResourceIdentifier: r:%+v", r)
	return &r, nil
}
Given a resource identifier and a kind, "Project", "Cluster", "DBUser", etc...
package util
import (
	"fmt"
	"github.com/rs/xid"
	"log"
	"strings"
)
type ResourceIdentifier struct {
	ServiceName  string
	DeploymentID string
	ResourceType string  
	ResourceID   string
	Parent       *ResourceIdentifier
}
func (t ResourceIdentifier) String() string {
	fields := []string{}
	if t.DeploymentID != "" {
		fields = append(fields, "mongodb", t.DeploymentID)
	}
	fields = append(fields, t.ResourceType, t.ResourceID)
	if t.Parent != nil {
		fields = append(fields, t.Parent.String())
	}
	return strings.Join(fields, "+")
}