Config createConfig(Cluster cluster, StackId stackId, AmbariManagementController controller,
      String type, String tag, Map<String, String> properties,
      Map<String, Map<String, String>> propertyAttributes) throws AmbariException {

    // if the configuration is not new, then create a timestamp tag
    if (cluster.getConfigsByType(type) != null) {
      tag = "version" + System.currentTimeMillis();
    }

    Map<PropertyType, Set<String>> propertiesTypes = cluster.getConfigPropertiesTypes(type);
    if(propertiesTypes.containsKey(PropertyType.PASSWORD)) {
      for(String passwordProperty : propertiesTypes.get(PropertyType.PASSWORD)) {
        if(properties.containsKey(passwordProperty)) {
          String passwordPropertyValue = properties.get(passwordProperty);
          if (!SecretReference.isSecret(passwordPropertyValue)) {
            continue;
          }
          SecretReference ref = new SecretReference(passwordPropertyValue, cluster);
          String refValue = ref.getValue();
          properties.put(passwordProperty, refValue);
        }
      }
    }

    return controller.createConfig(cluster, stackId, type, properties, tag, propertyAttributes);
  }
Creates a new configuration using the specified tag as the first version
tag. Otherwise, the configuration will be created with {@literal version}
along with the current timestamp.

@param cluster
         the cluster (not {@code null}).
@param stackId
         the stack to create the new properties for
@param controller
         the controller which actually creates the configuration (not
         {@code null}).
@param stackId
         the stack to create the new properties for
@param type
         the new configuration type (not {@code null}).
@param tag
         the initial tag; if this configuration already exists, it will use
         the timestamp along with {@literal version}.
@param properties
         the properties to persist (not {@code null}).
@param propertyAttributes
         the attributes to persist, or {@code null} for none.
@return
@throws AmbariException
ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java