protected boolean isDependencyManaged(Stack stack, String component, Map<String, Map<String, String>> clusterConfig) {
    boolean isManaged = true;
    String externalComponentConfig = stack.getExternalComponentConfig(component);
    if (externalComponentConfig != null) {
      String[] toks = externalComponentConfig.split("/");
      String externalComponentConfigType = toks[0];
      String externalComponentConfigProp = toks[1];
      Map<String, String> properties = clusterConfig.get(externalComponentConfigType);
      if (properties != null && properties.containsKey(externalComponentConfigProp)) {
        if (properties.get(externalComponentConfigProp).startsWith("Existing")) {
          isManaged = false;
        }
      }
    }
    return isManaged;
  }
Determine if a component is managed, meaning that it is running inside of the cluster
topology.  Generally, non-managed dependencies will be database components.

@param stack          stack instance
@param component      component to determine if it is managed
@param clusterConfig  cluster configuration

@return true if the specified component managed by the cluster; false otherwise
ambari-server/src/main/java/org/apache/ambari/server/topology/BlueprintValidatorImpl.java