turbot/steampipe-mod-aws-compliance

Control: Elasticsearch domains should have at least three data nodes

Description

This control checks whether Elasticsearch domains are configured with at least three data nodes and zoneAwarenessEnabled is true.

Usage

Run the control in your terminal:

powerpipe control run aws_compliance.control.es_domain_data_nodes_min_3

Snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe control run aws_compliance.control.es_domain_data_nodes_min_3 --share

SQL

This control uses a named query:

select
arn as resource,
case
when elasticsearch_cluster_config ->> 'ZoneAwarenessEnabled' = 'false' then 'alarm'
when
elasticsearch_cluster_config ->> 'ZoneAwarenessEnabled' = 'true'
and (elasticsearch_cluster_config ->> 'InstanceCount')::integer >= 3 then 'ok'
else 'alarm'
end status,
case
when elasticsearch_cluster_config ->> 'ZoneAwarenessEnabled' = 'false' then title || ' zone awareness disabled.'
else title || ' has ' || (elasticsearch_cluster_config ->> 'InstanceCount') || ' data node(s).'
end as reason
, region, account_id
from
aws_elasticsearch_domain;

Tags