Skip to content

Ensure Elasticsearch domain is using three or more dedicated master nodes.

Description

Amazon Elasticsearch Service uses dedicated master nodes to increase cluster stability.

Rationale

A dedicated master node performs cluster management tasks, but does not hold data or respond to data upload requests. This offloading of cluster management tasks increases the stability of your domain.

Applies To

  • Databases

Tags

This rule is applied when the following tags are present:

Tag With Value
secureclouddb/provider aws
secureclouddb/service elasticsearch

Default Rule

/**
 * @param {Object} awsElasticsearchDomainStatus - Elasticsearch Domain Status
 * @returns {boolean} true if the domain is using three or more dedicated master nodes
 */
function validate(databaseSettings) {

    const success =
        databaseSettings.awsDatabaseInstance &&
        databaseSettings.awsDatabaseInstance.elasticsearchDomain &&
        databaseSettings.awsDatabaseInstance.elasticsearchDomain.elasticsearchClusterConfig &&
        databaseSettings.awsDatabaseInstance.elasticsearchDomain.elasticsearchClusterConfig.dedicatedMasterEnabled &&
        databaseSettings.awsDatabaseInstance.elasticsearchDomain.elasticsearchClusterConfig.dedicatedMasterCount &&
        databaseSettings.awsDatabaseInstance.elasticsearchDomain.elasticsearchClusterConfig.dedicatedMasterCount >= 3

    return {
        success,
    }
}

// invoke
validate(databaseSettings);